Forum Discussion
JSON formatting to call a flow when a new item is created on a SharePoint list
- May 12, 2022ah 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
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.
- XimoMay 11, 2022Brass 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 WardMay 11, 2022Bronze 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)- XimoMay 11, 2022Brass Contributor
Hi Warwick,
having a normal flow as suggested implies actually 3 flows per site (Project Site), I have three lists (Risks, Issues and Lessons) per site, multiplied by the number of Projects (+400) is unbearable. On top of that flows are not saved on a site template used when a new project is created, so we should create the flows right after the project site is created with each project.So I am looking for only one flow, like a Site Collection flow, that works for all lists, on all existing sites (Project Sites) and on future sites created with each new project.
If there is an option to use any type of condition in JSON to trigger a "universal" flow then all current and future project sites lists will benefit from it. I am aware of having a button to trigger a flow but I want to cover the "what if" case when the Project Manager created the item but did not click on the button, so triggered automatically once created would be the best solution. That is why I am looking at conditions like Created equals Modified to call that Site Collection flow but not clear how to build this in JSON at the item list level.