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

Want a trigger condition based on words in filename

I'm trying to build a trigger condition for my flow so the flow will only trigger if the condition is met. I want the condition to be if the filename contains the word 'drivers'.

 

I tried using this: 

 

@contains(triggerBody()?['Name'],'drivers')

 

Drogon_0-1657722342481.png

 

 

but got the error message: 

 

InvalidTemplate. Unable to process template language expressions for trigger 'When_a_file_is_created_or_modified_(properties_only)' at line '1' and column '17042': 'The template language function 'contains' expects its first argument 'collection' to be a dictionary (object), an array or a string. The provided value is of type 'Null'.'.

 

Thanks for any help you might have!

1 ACCEPTED SOLUTION

Accepted Solutions
Drogon
Frequent Visitor

Figured it out - I was missing {} brackets, so a simple syntax error. Once I added them in, the flow worked great!

 

@contains(triggerBody()?['{Name}'],'drivers')

 

So whenever my filename contains the text drivers, the flow will trigger. 

View solution in original post

1 REPLY 1
Drogon
Frequent Visitor

Figured it out - I was missing {} brackets, so a simple syntax error. Once I added them in, the flow worked great!

 

@contains(triggerBody()?['{Name}'],'drivers')

 

So whenever my filename contains the text drivers, the flow will trigger. 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (5,789)