Can you use and & or in workflows

Hi,
I’m creating a workflow which should run on certain conditions. The condition is that the logged-in user should have a certain userType ( custom field).

I achieved this using 2 statements as can be seen in the attached photo.

My question is whether I write 1 statement and use is “doctor” or “clinicStaff” instead of repeating the entire condition and connecting them using " and / or "
2020-03-03_11-03-46

If I understand your question, what’s depicted appears correct. Does it behave as intended?

Have you tried it the other way? I suspect you’d find that it would be an invalid expression.

That is the only way yes.

The expression works as intended but I find it quite inefficient. I rather write the expression once use the “and” , “or” just for the values.

If I want the workflow work for 10 userType s does it mean I need to repeat the same conditions 10 times and connect them using and statements?

I think there must be a better way such as providing a list of values.

You might be able to do something like that. You’d be responsible for creating / maintaining the list somehow (custom state, option set, or something), but then you could say something like “value is in list” as the conditional expression. At least I think that would work… :thinking:

EDIT: Or maybe it’s “list contains value”, but you get the idea.

1 Like

Thank you for the suggestion. I wasn’t aware of the “option set” feature. It helped me to solve the issue.

I had to change the logic order to “Option Set contains Current User’s Usertype…” since the “Current User’s userType contains Option Set…” did not work.