web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to get the ID in F...
Power Automate
Answered

How to get the ID in Flow Apply to each Create item step?

(1) ShareShare
ReportReport
Posted on by 126

Hi Community friends,

@EddieE

I have a Power Automate Flow where I am trying to get the ID of a Share Point record [Response from Approver] I created in the Flow from the response in "Start and wait for an approval" action which has "Apply to each"

 

reveur007_0-1705538837515.png

 

 

-I initialized a variable, varList2ID as integer with initial value =0, As I am trying to set the variable by pulling the ID of the item/record created in "Create item List2" step. In the "Dynamic content" -It does not show the ID of the Apply to each-> 'Create item List2' step-> shows only "Current item". I am trying to pull the ID from the current item: tried following 2 expressions after' Current item' as follows

 

reveur007_1-1705538837515.png

 

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

and also tried

item()?['body/ID']

But getting Invalid expression error, I tried to typecast using int() outside the outputs(….) and item()…- but no luck!

I would appreciate any suggestion. Many thanks in advance!

Categories:
  • Verified answer
    365-Assist Profile Picture
    2,327 Moderator on at

    I believe an issue is caused by the Current Item in the Set Variable.

    I suggest you add another variable that is captured in the For Each

    365Assist_0-1705540077640.png

    ---------------------------------------------------
    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

    Subscribe: https://www.youtube.com/channel/UCFpvUlpx84FuIPOdInGKMTw

    Regards
    Darren Lutchner - 365 Assist

  • Verified answer
    v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @reveur007 ,

    Put the 'set variable' control into the 'Apply to each' loop.

    I did a test for your reference.

    In my scenario:

    vyetonggumsft_2-1705541642217.png

    Best Regards,

    Sunshine Gu

  • reveur007 Profile Picture
    126 on at

    Thanks a lot for the quick response! 🙂

  • reveur007 Profile Picture
    126 on at

    Appreciate it a lot for your prompt response showing all the steps! 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 355

#2
11manish Profile Picture

11manish 336 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard