cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nnvm
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
edgonzales
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  

nnvm
Frequent Visitor

Sure, here you have.

 

flow.pngfile name.png

@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

@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

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.

  

 

@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

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.'.

@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
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (51,394)