cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Power Automate - Conditional contains

Hi Community,

 

I wondering if you can help with the following flow: I`m trying to trigger an approval flow when a file is created or modified on a SharePoint folder. I added a condition to identified if the file name contains certain information but the output of this condition is always false even though i am adding the correct information in the file name. I would like to know how i should do it in order the condition identify the file name.

 

 
8 REPLIES 8
Highlighted
Super User II
Super User II

@nnvm 

Hey there.  Can you show us a pic of the condition? Maybe the input (filename) as well?  It might be something as simple as quotes or something, but would like to see what you have first.

 

Thanks!

-Ed  

Highlighted

Sure, here you have.

 

flow.pngfile name.png

Highlighted

@nnvm at the risk of stepping on @edgonzales' answer, the text in the condition is case sensitive so it is looking for LAX whereas your file has Lax.

Rob
Los Gallardos

Highlighted

@nnvm 

I believe thie issue is that string comparisons are case sensitive.  Try wrapping the left side of your conditions in an toUpper() expression which will convert the string to upper case.

image.png

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Highlighted

Thanks for your solution but it did not work. 😔

 

The following error appeared: Unable to process template language expressions for action 'Condition' at line '1' and column '2664': 'The template language function 'toUpper' expects its parameter to be a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#toUpper for usage details.'

 

I also tried modifying the original flow From LAX to Lax in order to match the file name but it is still bringing as result false.

  

 

Highlighted

@nnvm 

Try wrapping the expression that you have in a coalesce() expression which will provide a default value if your first value is null:'

coalesce(toUpper(triggerBody()?['{FilenameWithExtension}']),'NoValue')
 
 
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Highlighted

Unfortunately it did not work either. I continue getting the same message

 

Unable to process template language expressions for action 'Condition' at line '1' and column '2664': 'The template language function 'toUpper' expects its parameter to be a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#toUpper for usage details.'.

Highlighted

@nnvm 

Sorry about that....

What I should have posted is this:

toUpper(coalesce(triggerBody()?['{FilenameWithExtension}'],'No Value'))
The concept is that the text No Value will be returned if the file name is null.
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (13,054)