Hello,
Has anyone been able to successfully write a flow that uses a trigger condition on a sharepoint document library that only triggers when a specific file type is uploaded (.docx in this example)?
I am having a hard time getting a sharepoint document library to trigger only on docx files. Long story short, I am using the flow to convert docx files to pdf. The flow is looping back a 2nd time when the pdf file is created. If i can get the trigger condition to work, it will save me a 2nd flow run.
The main issue is getting the file type, file extension recognized. How can I write the trigger condition expression to do what I need? The other otpion is to extract the file name extension in sharepoint into another column as text. Then modify my trigger condition to look at that new column.
Solved! Go to Solution.
Hi @JasonK
Use following trigger condition for when an item is created or updated
@contains(triggerBody()?['{FilenameWithExtension}'],'.docx')
Regards,
Reza Dorrani
Regards,
Reza Dorrani
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @JasonK
Use following trigger condition for when an item is created or updated
@contains(triggerBody()?['{FilenameWithExtension}'],'.docx')
Regards,
Reza Dorrani
Regards,
Reza Dorrani
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @JasonK ,
Please use the trigger "When a file is created or modified (properties only)" in the flow:
And use the expression below in the trigger Condition:
@contains(triggerBody()?['{FilenameWithExtension}'],'.docx')
Best regards,
Alice
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Awesome, Thank you for the info. Worked as stated.
Does anyone have any training resources on how to write Trigger conditions or better understand the structure?
The following worked for me for running on PDF documents only with the 'When a file is created or modified in a folder' Trigger:
@equals(triggerOutputs()['headers']['Content-Type'],'application/pdf')
Kind Regards,
Hi @RezaDorrani ,
I tried using this trigger for my flow: @contains(triggerBody()?['{FilenameWithExtension}'],'.jpg')
but got the trigger error message below. It did not even run when I tested it.