cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
silvana1
Regular Visitor

How to pass SharePoint Item ID from one flow to another using HTTP

I want users to click on an item in a SharePoint List and run a flow. I want this 1st flow to trigger a second flow to run. 
Can someone direct me to/share the code for how to pass the item ID from one flow to another using HTTP?

 

Here's what I tried. However I could not get an items in 2nd flow:
1st flow:

Trigger: "For a Selected Item".
I entered values for SP site and list.
Action: HTTP:
Method = POST
URI: copied from trigger in 2nd flow
Body: 
{
"ID": "@{triggerBody()?['entity']?['ID']}"
]
2nd flow:

 Trigger: "When a HTTP request is received".
Request Body:
{
"type": "object",
"properties": {
"ID": {
"type": "string"
}
}
}

Action: Get Item
ID: ID field from the trigger. 


Thanks!

Silvana

2 ACCEPTED SOLUTIONS

Accepted Solutions
efialttes
Super User III
Super User III

Hi

In your HTTP request from your first flow, you should use this instead

"@{string(triggerBody()?['entity']?['ID'])}"

or

declare ID as integer on your second flow's trigger, and remove the doublequotes surrounding @triggerBody()?['entity']?['ID'] on your first flow

I tend to use the second approach

Hope this helps

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

v-bacao-msft
Community Support
Community Support

 

Hi @silvana1 ,

 

Have you had an opportunity to apply @efialttes 's recommendations to adapt your Flow?

In the second Flow, when defining the request body, you need to change the ID type to integer.

The type of Item ID is actually Number instead of String.

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
efialttes
Super User III
Super User III

Hi

In your HTTP request from your first flow, you should use this instead

"@{string(triggerBody()?['entity']?['ID'])}"

or

declare ID as integer on your second flow's trigger, and remove the doublequotes surrounding @triggerBody()?['entity']?['ID'] on your first flow

I tend to use the second approach

Hope this helps

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

v-bacao-msft
Community Support
Community Support

 

Hi @silvana1 ,

 

Have you had an opportunity to apply @efialttes 's recommendations to adapt your Flow?

In the second Flow, when defining the request body, you need to change the ID type to integer.

The type of Item ID is actually Number instead of String.

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Users online (2,285)