cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tenn_tazz26
New Member

PowerAutomate will not copy/create file based on a keyword in a newly created file

I am trying to get PowerAutomate in Office365 to look into a folder and if a file gets created and somewhere in the filename it has the word _hold then it should create a copy of that file in another folder. I have tried several variations of this and can't seem to get it to work. As a test I also created an action for No and I copied a file from my computer and saved it as test_hold.pdf to the Options folder listed as the first step. It did the No Action instead of the Yes action because it saved it to the PG folder. It is as if PowerAutomate sees the word _hold and does the No action instead of the Yes action. I have attached what the flow looks like. Any ideas where I am going wrong? 

 

tenn_tazz26_0-1663770523560.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-liwei-msft
Community Support
Community Support

Hi @tenn_tazz26 

 

You should replace the dynamic content of File name with an expression:

triggerOutputs()?['headers']?['x-ms-file-name']

vliweimsft_0-1663830631201.jpeg

vliweimsft_1-1663830641601.png

vliweimsft_2-1663830654888.png

 

Best Regards,

Levi

View solution in original post

3 REPLIES 3
lbendlin
Impactful Individual
Impactful Individual

The comparison is case sensitive.  Use toUpper or similar to prevent that from being an issue.

v-liwei-msft
Community Support
Community Support

Hi @tenn_tazz26 

 

You should replace the dynamic content of File name with an expression:

triggerOutputs()?['headers']?['x-ms-file-name']

vliweimsft_0-1663830631201.jpeg

vliweimsft_1-1663830641601.png

vliweimsft_2-1663830654888.png

 

Best Regards,

Levi

tenn_tazz26
New Member

Levi, that worked great. Thank you so much. 

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.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,641)