1

Using SharePoint Designer 2013, I'm actually doing some if statements in a workflow with or and and in the condition. But I'm confused as what priority is given for these...

Is the and joining the condition on both side like if they were in parenthesis? Is there anyway to make sure some part are processed first?

E.g.:

If ContentType equals Apple
and Color equals Red
or Color equals Green
    Log to history "Good fruit!"

Would that mean that any "Red Apple" or any "Green" fruit would return true? Because I'm trying to get the ors together.

Only way I can see to make it work right now is that:

If ContentType equals Apple
    If Color equals Red
    or Color equals Green
        Log to history "Good fruit!"
1

Try this:

If ContentType equals Apple and Color equals Red 
   or 
   ContentType equals Apple and Color equals Green
Log to history "Good fruit!"

If you have more IF statements, you can use gradually fitering like, you can also use in IF statements logic operators like || (OR) , && (AND) for the values:

  • 1.level - If Color eq Red || Blue || Green
  • 2.level - If ContentType eq Apple || Orange

You just write these values into value window :

enter image description here

enter image description here

Or just look here, there are some information too.

  • So, from your answer, the and has the priority over the or, meaning this couldn't work without replicating the ContentType equals Apple? Because what I'm trying to achive would be the equivalent of having 5 content types (or) and 1 color (and), but what if, let's say, we also added Pear and Tomato as a valid red / green and also added Yellow as a valid color? That would give us 9 lines? So we would have 9 statements instead of 2 like this: If (Pear or Apple or Tomato) and (Red or Green or Yellow). – Marc-André Jan 29 at 16:18
  • Yes i think you must do it this ways, cause you cannot use ')' '(' in the code right? If you can use (), so you can define your priorities this way. If you have complicated IF statement i can try it, where you want to use this statements? – Zdeněk Vinduška Jan 29 at 17:55
  • That is the point of the question. If there is any way to set priority on some part of the statement, but AFAIK, there's no way to add '(' or ')' in SharePoint Designer. Are you aware of any way to do so? Otherwise, I'll have to keep the only way I found in my question (embedded ifs). – Marc-André Jan 29 at 21:04
  • But where you want to use these IF statements? Yes probably the one i wrote is the only one solution... – Zdeněk Vinduška Jan 29 at 21:05
  • 1
    but what in SPdesigner? you can creeate here workflows, views, and more :D understand? if it in workflow there can be done something else :) – Zdeněk Vinduška Jan 29 at 22:20

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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