Forum Discussion
SharePoint List JSON, IF Blank Field Formatting
Hi there jeremyjabrams !
So I kind of have a solutions which involves creating a calculated column, let me know if this works for you. If not, ill go back to the drawing board.
1) Create a calculated column with the formula =IF(ISBLANK(REQUEST),"Blank","Not Blank"), this will read the "REQUEST" column to see if there is a value or not. Should look like so.
2) Once you have the conditional formula column set up. You can then have your JSON for the "REQUEST FORM" column see if the value in the calculated column is "Blank" or "Not Blank". IF Blank, show the form.
It should look like this:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "a",
"txtContent": "REQUEST FORM",
"attributes": {
"target": "_blank",
"class": "sp-field-quickAction",
"href": "PUTYOURLINKINBETWEENTHEQUO"
},
"style": {
"display": "=if([$TestDisplay] == 'Blank', 'inline', 'none')"
}
}
3) From there you can just hide the TestDisplay values by using JSON to format the column:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"style": {
"display": "none"
}
}
and you final product should look like so.
I can see that the TestDisplay column showing can make the form look not so nice.
I will continue to play around to see if i can get it all in one JSON but i was struggling with it as well.
- jeremyjabramsMay 19, 2025Copper Contributor
Thank you very much, DChenIT.
Your solution worked perfectly!
I did make two minor modifications: I wanted REQUEST FORM to show when REQUEST was Not Blank, and I used the 'flex' display attribute instead of 'inline.' Otherwise, the solution you provided was great!I can easily modify the appearance of the form, so adding a column is not really a factor.
Here is the JSON:
Here is the result:
I had been messing with this for at least five days, so thank you again for your help. 🤜🤛
- DChenITMay 21, 2025Brass Contributor
Glad I was able to help!