cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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

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

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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (12,758)