SOLVED

JSON formatting to call a flow when a new item is created on a SharePoint list

Brass Contributor

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!

6 Replies
I 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.

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

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

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.

best response confirmed by Ximo (Brass Contributor)
Solution
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-webhook...
Thank you Warwick for the hint, much appreciated! ;)
1 best response

Accepted Solutions
best response confirmed by Ximo (Brass Contributor)
Solution
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-webhook...

View solution in original post