SOLVED

SharePoint List column formatting - CardProps not working if input column is hidden

Brass Contributor

JSON Formatting Level: BEGINNER

 

I am trying to hide some column in oder to have a clean list view and to provide information if required via CardProps (info column).
If the input column (Description) for the CardProps is visible the box opens as expected once you click the icon.

In case the input column (Description) is hidden the box does not open on click or is kind of empty and shows nothing. 

 

visible input column

CardProps visible input column.PNG

 

hidden input column

CardProps hidden input column.PNG

 

{
"elmType": "div",
"attributes": {
"iconName": "Info",
"class": "ms-fontColor-red ms-fontSize-xxl"
},
"customCardProps": {
"openOnEvent": "click",
"formatter": {
"elmType": "div",
"txtContent": "[$Description]"
}
}
}
 
BTW: I would like to show additional input in the CardProps from other columns like a link etc. 
5 Replies
best response confirmed by Mehmet Demirörs (Brass Contributor)
Solution

@Mehmet Demirörs 

This is the expected behavior in SharePoint online modern experience.

 

In order to add the reference to the column in JSON (column/view) formatting, you have to show that column in the list view (as you are referencing it using [$Description]). Hiding the column from list view will not work in this case.


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Dear @ganeshsanap and @Mehmet Demirörs,

 

Do you know if there is an existing uservoice entry to allow using hidden fields? If not what about inserting it? Which section of https://sharepoint.uservoice.com/ would be better? I suppose SharePoint Dev Platform but I'm not sure.

 

Regards

Gianmaria

@gianmaria_leoni there doesn't appear to be an existing uservoice request to allow hidden columns in the JSON view format. The list of JSON-related requests is here.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

I am not sure if there is already a existing uservoice but I can give a hint how i solved the issue.
In the column settings I chose calculated value to make currentfield value same a hidden column value. This way I could show content in a cardprop even if the value where the content is coming from is hidden. Hope this may help you as well.
1 best response

Accepted Solutions
best response confirmed by Mehmet Demirörs (Brass Contributor)
Solution

@Mehmet Demirörs 

This is the expected behavior in SharePoint online modern experience.

 

In order to add the reference to the column in JSON (column/view) formatting, you have to show that column in the list view (as you are referencing it using [$Description]). Hiding the column from list view will not work in this case.


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

View solution in original post