question

ErshadNozari-6158 avatar image
0 Votes"
ErshadNozari-6158 asked ErshadNozari-6158 edited

Logic Apps SharePoint Connector - When a file is created or modified in a folder

I have an integration scenario where I need to pull documents from SharePoint Online and submit the content (PDF) to a downstream API. I'm using the When a file is created or modified in a folder trigger to pull documents from a SharePoint library. My question is whether there is a way to set a filter on the trigger so that only PDF documents are retrieved i.e. (*.pdf)?




azure-logic-apps
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @ErshadNozari-6158, Thank you for reaching out. I am currently working on the issue faced, I will share my updates soon.

1 Vote 1 ·
ErshadNozari-6158 avatar image
1 Vote"
ErshadNozari-6158 answered ErshadNozari-6158 edited

Hello @ChaitanyaNaykodiMSFT-9638 - it is achievable by configuring Setting on the trigger
84654-image.png

and adding the Trigger Condition: @endsWith(trigger().outputs?['headers']?['x-ms-file-name'], '.pdf')
84590-image.png




image.png (8.2 KiB)
image.png (12.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ChaitanyaNaykodiMSFT-9638 avatar image
0 Votes"
ChaitanyaNaykodiMSFT-9638 answered

Hello @ErshadNozari-6158, AFAIK the filter cannot be set on the trigger itself but you can add a conditional statement to run any further actions only for PDF documents as shown below.
1. On the trigger you need to set the "Infer Content Type" to yes.
84683-image.png
2. Then you can add a condition which checks if File content type is equal to application/pdf
84647-image.png

If you wish the trigger itself had the filter, you can create a feedback item on our UserVoice channel. Please let me know if there are any concerns. Thank you!



image.png (5.9 KiB)
image.png (16.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.