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

Filter the Trigger "When a file is created or modified in a folder" to only run if a specific file is created or modified in a folder

Hi,

I have two files in a sharepoint folder and I want to run a flow only when both files are modified in that folder.

The sharepont folder is "/Documentos Partilhados/BI_Imagens" and the files in this folder are "BI_Page_1.png" and "BI_Page_2.png

PauloC_0-1633014795952.png

The flow :

PauloC_1-1633015304722.png

and the condition i' trying to use is:

@And(equals(triggerBody()?['{FullPath}'],'Documentos Partilhados/BI_Imagens/BI_Page_1.png'),equals(triggerBody()?['{FullPath}'], 'Documentos Partilhados/BI_Imagens/BI_Page_2.png'))

PauloC_2-1633015534748.png

But the flow doenst trigger when both files are modified.

Does anyone know how to solve this issue and help me? Are my conditions written wrong?

Thank you in advance!

 

4 REPLIES 4
eric-cheng
Solution Sage
Solution Sage

Hi @PauloC ,

 

You can use the below to get the filename instead of matching the full path to use in yohr trigger condition.

 

triggerBody()?['{FilenameWithExtension}']

 

Please note the following:

 

* This is available in 'when a file is created or modified (properties only)'.  You may need to check to see if it is also available in your folder trigger.  If not, swap it across

 

* Be careful of case sensitivity. You can use toLower() to format everything to lowercase

 

Here is a reference post

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

PauloC
New Member

Hi eric,

It works well when i use: @equals(triggerBody()?['{FilenameWithExtension}'],'BI_Page_1.png')

but It doesn't work whem i use: @And(equals(triggerBody()?['{FilenameWithExtension}'],'BI_Page_1.png'), equals(triggerBody()?['{FilenameWithExtension}'],'BI_Page_2.png'))

Hi @PauloC 

You can use 'or' to combine the two conditions. Trigger the flow when one of the files is modified.

@or(equals(triggerBody()?['{FilenameWithExtension}'],'BI_Page_1.png'), equals(triggerBody()?['{FilenameWithExtension}'],'BI_Page_2.png'))

If you want to trigger this Flow when both files are modified, I am afraid it is not supported.

Best Regards.

eric-cheng
Solution Sage
Solution Sage

Hi @PauloC 

 

As mentioned above, you will need to use OR which will trigger when either files are modified.

 

You could look at creating a scheduled flow that checks the timestamp of both files but it won't be instantaneous. 

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (4,059)