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:
- 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
- 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
- After then, you will use SharePoint REST API to get file details.
- Once the Logic App receives the webhook:
- Use the
resource
URL in the payload to get the document's metadata. - Modify or update the metadata as needed using the "Update file properties" action. https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-lists-and-list-items-with-rest
- 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.