Blog Post

Microsoft SharePoint Blog
1 MIN READ

Re: Building immersive user experiences with SharePoint view formatting

ericleigh007's avatar
ericleigh007
Copper Contributor
Mar 14, 2019

Chris McNultyI see Jeffrey Thorpe reply on the syntax

 

=if([$something] == '' && [$somethingElse] == '', blah, blah) but I just tried

=if([$something] == '' || [$somethingElse] == '', one is blank, one is blank) and that doesn't work as expected.

Can you guys point to a COMPLETE syntax for the complex conditionals?

Just to complete this, I also tried the or( thisone, thisotherone) syntax and that didn't do it for me either.

Here's a more complete example:

 

    "style": {
      "display": "=if([$Personal_x0020_Contact] != '' && [$Personal_x0020_Contact.email] != @me, 'none', 'flex')" }  // works

    "style": {
      "display": "=if([$Personal_x0020_Contact] == '' || [$Personal_x0020_Contact.email] == @me, 'flex', 'none')" }  // doesn't

    "style": {
      "display": "=if(or([$Personal_x0020_Contact] == '', [$Personal_x0020_Contact.email] == @me), 'none', 'flex')" }  // doesn't


I can see how the || might not be the correct syntax, but the OR should work, right?

 

BTW, these are not meant to be identical logic -- just examples.

 

 

 

 

Published Mar 14, 2019
Version 1.0
No CommentsBe the first to comment