Home > Software design >  Multiple conditions with contains in power automate desktop
Multiple conditions with contains in power automate desktop

Time:11-17

I want to evaluate multiple conditions in one If statement in Power Automate Desktop. I have been able to do it with the basic operators (=, >, <, <>, etc.) and using IsEmpty. But I have not found any documentation about how to use it with these:

  • Contains
  • Does not contain
  • Starts with
  • Doesn't start with
  • Ends with
  • Doesn't end with

I would like to evaluate something like this:

%strFileContents Contains 'word' and strFilePath Does not contain '.txt'%

I know that I can achieve this with multiple ifs but I would like to know if it can be done in a single one.

Thanks.

CodePudding user response:

%Contains(strFileContents, 'Word', True) AND NOT(Contains(strFilePath,'.txt.))%

You can add as many AND or OR as you like to evaluate the condition.

  • Related