how to trigger a logic app when a document is created in any document library on a Sharepoint site

David Phillips (AU) 6 Reputation points
2025-05-07T04:43:36.7566667+00:00

HI, I have a Sharepoint site being used for document management. Using Logic App we deploy a Document Library for each customer, and then project folders in each customer library. I'd like to be able to trigger one Logic App to run to update metadata when a document is created in any of the customer document libraries. I would like to do it all from one Logic App, and not have one Logic App per Library.

Any thoughts please?

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,496 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sina Salam 21,226 Reputation points Moderator
    2025-05-09T00:24:33.7266667+00:00

    Hello David Phillips (AU),

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand regarding your explanations that you will need how to trigger a logic app when a document is created in any document library on a Sharepoint site.

    The best approach is to use SharePoint Webhooks with Azure Function + Logic App since Logic App cannot directly monitor all libraries, I will recommend the below step by steps:

    1. Use a PowerShell script or Azure Function to register a webhook for each document library. So that each webhook will call a single HTTP-triggered Logic App or Azure Function. See more details here - https://learn.microsoft.com/en-us/sharepoint/dev/apis/webhooks/lists/create-subscription
    2. Then, use a single HTTP trigger Logic App that gets notified when any webhook fires, then parse the library and file metadata from the webhook payload. Check how to trigger Logic App from SharePoint Webhook - https://learn.microsoft.com/en-us/azure/connectors/connectors-native-webhook
    3. After then, you will use SharePoint REST API to get file details.
    4. Lastly, add retries, error handlers, and condition branches to ensure robustness. - https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-exception-handling

    I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.