cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JasonK
Level: Powered On

Trigger Conditions - On file type in Sharepoint Document library

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.

 

Capture.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Trigger Conditions - On file type in Sharepoint Document library

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

3 REPLIES 3
Super User
Super User

Re: Trigger Conditions - On file type in Sharepoint Document library

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

Community Support Team
Community Support Team

Re: Trigger Conditions - On file type in Sharepoint Document library

Hi @JasonK ,

 

Please use the trigger "When a file is created or modified (properties only)" in the flow:

1.png

 

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.

JasonK
Level: Powered On

Re: Trigger Conditions - On file type in Sharepoint Document library

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?

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 359 members 4,907 guests
Please welcome our newest community members: