Forum Discussion
JSON formatting to call a flow when a new item is created on a SharePoint list
Hi all,
I have flow defined with the first action as: 'When a HTTP request is received', would be possible with JSON to call that flow with parameters as the SiteCollection URL, the Subsite URL, the List ID and Item ID when a new item is created in the SharePoint Online list (modern style) using JSON formatting? (No button)
Maybe with a condition in JSON like if modified equals created?
Thank you!
- ah ok I see what you are trying to do now. JSON formatting will never be able to do this for you, I would look into webhooks to possible archive the functionality you're looking for https://docs.microsoft.com/en-us/sharepoint/dev/apis/webhooks/lists/overview-sharepoint-list-webhooks
- Warwick WardBronze ContributorI don't think you can configure a column action to call a custom REST endpoint.
I would create a on-demand flow which is started from the Column action/button. This flow can have the action which calls you HTTP endpoint you've already got setup.
I'm a bit confused but your request above, but you can also just have a flow trigger on a new item created.- XimoBrass Contributor
Thank you Warwick Ward,
The whole idea is to have a unique ID for Risks, Issues and Lessons in Project Online, without JavaScript as it is not supported OOB in modern SPO.
If the user registers a Risk it would trigger a call to a flow that would compose the unique ID for that item in that list and that flow would work for any list, in any subsite in the site collection.
For that purpose the flow accepts parameters to later on be able to update the specific item.
If the user has to click a button it will not click it, this is kind of left as possible human error so I am looking at something that is triggered in the backend calling that flow via http request when the user creates the item.
The idea comes from: Deploying a single flow to multiple SharePoint libraries/lists - InspiriBytes but my next step is figuring out a condition in JSON like if Modified equals Created then call the flow, because this will only happen once when a new item is created.
Hope it is better illustrated this way
- Warwick WardBronze Contributorsorry still confused what your trying to achieve.
- Why can't you just use a normal flow that triggers on item creation and then calls the HTTP to set the unique ID (no reason you can't pass through the parameters to the HTTP endpoint using this)
- Yes you would need to configure this on every list that you require the unique ID to be used (or use 3rd party solutions to duplicate)