Ershad Nozari
Ershad Nozari

Reputation: 667

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)?

Upvotes: 0

Views: 2409

Answers (1)

Hury Shen
Hury Shen

Reputation: 15744

For this requirement, you can click "Settings" of your trigger.

enter image description here

And then add the expression @contains(triggerBody()?['{FilenameWithExtension}'], '.pdf') to "Trigger Conditions".

enter image description here

After that, the logic app can just be triggered with file name which contains .pdf.

=================================Upate==============================

You can change the expression to:

@contains(trigger().outputs?['headers']?['x-ms-file-name'], '.pdf')

Upvotes: 1

Related Questions