Forum Discussion
Conditional formatting for item containing data
- Jul 14, 2022
Beth_Culpepper Open an item on your list and select Edit Columns
Hover over the column you want to hide, click on the vertical dots, and select Edit conditional formula
Enter the formula and click save:
=if([$ID] >'0', 'true', 'false')That will hide the column on new but not from the views or on edit.
Beth_Culpepper Open an item on your list and select Edit Columns
Hover over the column you want to hide, click on the vertical dots, and select Edit conditional formula
Enter the formula and click save:
=if([$ID] >'0', 'true', 'false')
That will hide the column on new but not from the views or on edit.
- ganeshsanapJul 15, 2022MVP
PamDeGraffenreid I just tried using the code you provided and column is hidden from all the list forms (not just new form).
Previously [$ID] context was not available on the list forms. Does Microsoft added it recently?
I am getting below error message on developer tool console: ID was not found on the data object.
Please consider giving a Like if my post helped you in any way.
- Jul 18, 2022
ganeshsanap Fair question... I tried using $ID because I saw another post recently where someone was able to to get it work. It is a supported column type with column formatting, and I don't see any exclusions listed here Show or hide columns in a list form | Microsoft Docs
Beth_Culpepper If you have problems with that at some point with checking the ID column, look for another condition that might work. Or jump back on, and we'll be happy to help you work out a condition that meets your requirements.
- ganeshsanapJul 19, 2022MVP
PamDeGraffenreid That's great. Can you please share the link of post you saw?
I am still not able to get the [$ID] in form JSON formatting & conditional formulas.
Column & view JSON formatting is different from this scenario where I can get the [$ID] without any problem.
Please consider giving a Like if my post helped you in any way.
- Beth_CulpepperJul 15, 2022Brass ContributorBrilliant! This worked perfectly, Pam, thank you SO much!