Selectively *hide* a field using JSON in a modern SharePoint list form

Copper Contributor

At work I'm learning some basic techniques to format a SharePoint list form using JSON. I've gotten far enough that I understand what's going on here:

 

=if([$ColumnName] == 'true', 'true', 'false')

 

(This causes the column I'm working on to be normally hidden, but become visible if a Yes/no switch 'ColumnName' is Yes)


...but I have a use case for something like this:

 

=if([$ColumnName] == 'true', 'false', 'true')

or perhaps

=if([$ColumnName] == 'false', 'true', 'false')

 

...where the column would be *visible* by default and then go hidden if the Yes/No switch is Yes.

 

I can't experiment until Tuesday, so I thought I'd search around some of the SharePoint forums to see if anyone has done something similar, but I've discovered that it's difficult to search for stuff like this (or perhaps I haven't figured out the correct phrasing).

 

Do you know if it's possible to flip the logic around like this?

 

0 Replies