Forum Discussion
SharePoint List Form Header
- Feb 25, 2022
SG523 Disregard my last answer. The fact that [$Closed] is a calculated column changes everything. Calculated columns are not available in custom form formatting since they are only calculated when the record is saved.
To make this work, you need to use the formula that is used in the calculated column in the formatting json. For example, if the [$Closed] column calculation is
IF([Status] = "Closed", "Yes","No")
Then use the same formula in the formatting json like this
"iconName": "=if([$Status]=='Closed','BoxCheckmarkSolid','BoxMultiplySolid')",
Hopefully this will fix the problem!
Please click Mark as Best Response & Like if my post helped you to answer or resolve 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.
SG523 There may not be enough detail for a complete answer, but I can see one issue. If Closed is a Yes/No field (Boolean), the conditional formats would look like this
"iconName": "=if([$Closed],'boxcheckmarksolid','boxmultiplysolid')"
"color": "=if([$Closed], 'green', 'red')"
You can also use [$Closed] == true
Hope this helps.
Please click Mark as Best Response & Like if my post helped you to answer or resolve 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.
- SG523Feb 24, 2022Brass Contributor
I changed it to this and it still does not work. Closed is Boolean.
"iconName": "=if([$Closed] ,'boxcheckmarksolid','boxmultiplysolid')"
How can I help get an answer to solve this? I need this header when not new. Except the box will change from red X to green check when the tag is closed.
And this for a new tag.
It would be nice to also have an image/logo to the left of everything as well.
Thanks
- Don KirkhamFeb 25, 2022MVP
SG523 This worked for me.
"iconName": "=if([$Closed],'BoxCheckmarkSolid','BoxMultiplySolid')", "color": "=if([$Closed], 'green', 'red')"
I don't understand the last line "It would be nice to also have an image/logo to the left of everything as well."
Please click Mark as Best Response & Like if my post helped you to answer or resolve 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.
- Don KirkhamFeb 25, 2022MVP
SG523 Disregard my last answer. The fact that [$Closed] is a calculated column changes everything. Calculated columns are not available in custom form formatting since they are only calculated when the record is saved.
To make this work, you need to use the formula that is used in the calculated column in the formatting json. For example, if the [$Closed] column calculation is
IF([Status] = "Closed", "Yes","No")
Then use the same formula in the formatting json like this
"iconName": "=if([$Status]=='Closed','BoxCheckmarkSolid','BoxMultiplySolid')",
Hopefully this will fix the problem!
Please click Mark as Best Response & Like if my post helped you to answer or resolve 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.
- SG523Feb 25, 2022Brass Contributor
A little more on this. I tried to just display the information form the Closed column and it just returns blank. This might point as to why I am not able to make the box change. Reminder that the Closed column is a calculated column with an output of boolean.
"children": [ { "elmType": "div", "txtContent": "=if([$Title]=='','New','Closed: '+[$Closed])" } ] },
should return Closed: Yes or True but instead I only get this.