cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
uklinde
Frequent Visitor

How to capture the ID of the SharePoint list item created with "Create item" action?

Dear all,

 

I'm just working on a Flow that is triggered from a PowerApp. It's intended to  created a new list item in SharePoint first, then raise an approval and finally write the approval decision to the list item. Now I got stuck in evaluating the item ID of the SharePoint item created (Create item action with dynamic URL + list name). I was expecting it's available as input variable for the following actions but it is not. I mean, doing a Get item query afterwards seems to be a bad option (expensive, error-prone).  

 

Maybe someone has already solved a similiar requirement and can help me?

 

Thank you so much in advance 👍

 

1 ACCEPTED SOLUTION

Accepted Solutions

Try using the below expression

 

outputs('Save_item_to_SPO_list')?['body/ID']

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

6 REPLIES 6
abm
Super User
Super User

Hi @uklinde 

 

Its all depends on how your design is? If you thinking to capture the url and id from Power App itself after the creation you have couple of options.

 

1. Create a flow When a http is received. Pass all the SharePoint list creation column values into the body. Next step create SharePoint item. Finally you can return the id of the newly created list item.

2. If you don't want to use Step 1 method then use a query under the SharePoint list which you created using some unique column values (Assume you have some unique values) and return the Id.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
uklinde
Frequent Visitor

Hi @abm, thanks a lot for your input 👍

 

capturing the ID from PowerApp is not needed but in the Flow itself since the approval results shall be written back to the item just created.

And yes, I also thought of the options you proposed. Especially the option to split Flow logic into two different Flows would be my favorite work-around: one Flow to create the SP item and another that has a When item created trigger and handles the approval.

But there are some drawbacks: increased complexity and even the need to purchase different Per Flow Plans instead of a single one (high transaction count) esp. since this pattern will be used more than once for our solution.

 

Therefore I'd like to know if there is a possibility to just get the ID of Create item action before implementing the work-around solution...

 

Thanks again!

 

@uklinde 

I may not be understanding you correctly, but the ID is available from Dynamic properties immediately after a create item action.

image.png

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
uklinde
Frequent Visitor

Hi @ScottShearer, thanks for your reply 🙂

You are right, the ID will be available when you are working with a known list at design time. In my case, the Flow has to deal with multiple list so the URL and list name are read from variables/parameters. And there I failed to get the ID since the Create item action does not come up in the dynamic props panel:  

 

Action:

uklinde_1-1619033133839.png

Lookup >> no ID found:

uklinde_2-1619033231573.png

 

Thanks again!

 

 

 

Try using the below expression

 

outputs('Save_item_to_SPO_list')?['body/ID']

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
uklinde
Frequent Visitor

Hi @abm and @ScottShearer ,

thank you so much - this way it works as desired 🚀

So the iten ID is not avaiable via dynamic properties window but internally and can be evaluated using expression. Thanks again for your quick and valueable assistance 👍👍

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,474)