0

I've successfully used non "not equal to" formulas to conditionally show/hide columns in SharePoint default forms.

Does anyone know if it is possible to use a "not equal to" operator? If so, what do I use?

The following did not work for me: <>. Full example:

=if([$Owner.email] <> '@me', 'true', 'false') 
0

2 Answers 2

1

Use this:

=if([$Owner.email] != '@me', 'true', 'false')

Check all available operators in conditional formula or JSON formatting at: JSON formatting operators

Documentations:

  1. Specify conditional formula to show or hide columns

Update from comments:

You can only use the columns which are visible in list form in conditional formula and form JSON formatting. So, you cannot use Author (Created by) or Modified by column value in formula. This is a known limitation in SharePoint.

More information at: Can ID column be displayed when configuring a list form header using JSON?

5
  • Thanks for the reponse, but no luck. I tried =if([$Author.email] != '@me', 'true', 'false') and it did not error out - the formula was accepted - but it did NOT work. NOTE: I changed Owner to Author.email (for item Created by). Nov 23, 2022 at 15:28
  • Unfortunately, you can only use the columns which are visible in list form. So, you cannot use Author (Created by) column value in formula. This is a known limitation in SharePoint. Nov 23, 2022 at 17:33
  • Oh! <facepalm> A thousand thank yous. For those finding their way here from the web, the takeaway is: -To use NOT in conditional formulas for show/hide, use: != -Limitation: You cannot use with non-visible P&G columns like Created by and Modified by. Custom site or list columns are fine and work as outlined by Ganesh Sanap and user79408. Marking both as answers. Nov 23, 2022 at 19:45
  • 1
    Does anyone know if AND(), OR() and NOT() statements are supported when trying to show or hide fields? I have a question specifically about that here which I am trying to answer: stackoverflow.com/questions/75167548/… Jan 19, 2023 at 3:52
  • I have answered your question on stack overflow. Jan 19, 2023 at 5:41
1

Try using != instead of <>

Formatting syntax reference

2
  • Thanks for the reponse, but no luck. I tried =if([$Author.email] != '@me', 'true', 'false') and it did not error out - the formula was accepted - but it did NOT work. NOTE: I changed Owner to Author.email (for item Created by). Nov 23, 2022 at 15:28
  • Oh! <facepalm> A thousand thank yous. For those finding their way here from the web, the takeaway is: -To use NOT in conditional formulas for show/hide, use: != -Limitation: You cannot use with non-visible P&G columns like Created by and Modified by. Custom site or list columns are fine and work as outlined by Ganesh Sanap and user79408. Marking both as answers. Nov 23, 2022 at 19:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.