2

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.

Dariusz Woźniak
  • 9,640
  • 6
  • 60
  • 73
Juan Puello
  • 25
  • 1
  • 5

1 Answers1

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

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

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83