Skip to main content

Notifications

Community site session details
Power Automate - Building Flows
Answered

Avoiding apply to each loops with first() function

Like (0) ShareShare
ReportReport
Posted on 4 Nov 2022 08:54:25 by 76

Hi,

 

I am trying to filter out the weight of certain products using a oData connector, I want to use the 'quantity' of this weight as input for a variable. I can target the specific quantity i need but Power automate automatically makes an 'Apply to each' loop. I want to avoid this so i use the 'first()' function, right now the expression in my 'Compose' is: 

 
first(outputs('Get_Weight')?['body/value'])
 

This works, but i don't get the output i need, it gives ' "quantity" : 7.5' as output,   but i need '7.5' as output so i can use it as a double and calculate with it

45f792c0-2792-4780-909a-dfe525dc79d9.png

 

e8a2c764-9584-4d2f-aab6-3b4103f2beb5.png

 

Thanks

  • Verified answer
    v-bofeng-msft Profile Picture
    on 04 Nov 2022 at 09:17:06
    Re: Avoiding apply to each loops with first() function

    Hi @Kryptic ,

     

    Please try:

    first(outputs('Get_Weight')?['body/value'])['quantity']

     

    Best Regards,

    Bof

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Automate - Building Flows

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 196 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 171 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 165

Overall leaderboard