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 / Help getting a value b...
Power Automate
Unanswered

Help getting a value back out of an array

(0) ShareShare
ReportReport
Posted on by 200

I have two data sets, one coming from Excel online, ans the other coming from a sharepoint list.  for both of these sources, i've used select to create an array.   

Frac_0-1674158215802.png

Frac_1-1674158228705.png

then for each item within SelectExcel, i have a condition to see if the output of SelectSP is contained in the current item.  this then resolves very simply to a compose where i can see if i have a match or not

 

Frac_2-1674158480981.png

 

I'm working with practice data sets, so each one has 3 items, with a 1:1 match on email address.   What i want to do is to write the score value from SelectExcel to the SP list, using SelectSP to identify the ID of the record that needs to be updated.  what i dont understand is how to get that ID value out of the SelectSP Array and into the ID field, since values from the array do not show up in the dynamic content.  how do i get this information back out of the array?

 

Frac_3-1674158783720.png

 

 

Categories:
  • OkanMTL Profile Picture
    703 Super User 2024 Season 1 on at

    Hello,

     

    You can try to set a variable (lets call it 'counter') to 0, and then for each loop increment this variable with 1.

    So whenever your condition passes, lets say on the second for each loop, this variable will have a value of 2.

    Then you can pass this variable to get your value from the ID array, so you will have ID[counter-1] as your input. And this will reach to the ID array from SelectSP > retrieve the 2nd value of the array > pass it to ID in Update item.

     

    I'm not sure if you know a lot about programming but counter-1 grabs the 2nd array here even though its value is 1. Because you start counting from 0 in programming... 

     

    Anyways good luck and let me know how it goes.

  • Frac Profile Picture
    200 on at

    @OkanAT  i think this makes sense, but i'm not sure how to actually implement this in power automate.  Do i enter the ID[counter-1] in as an expression in the ID field of the update item?

     

     

  • OkanMTL Profile Picture
    703 Super User 2024 Season 1 on at

    Yes, and declare the variable counter outside of your apply to each activity. 1 step before for example.

     

     

  • Frac Profile Picture
    200 on at

    @OkanAT i've declared the counter variable, and have it incrementing by 1 at the end of my flow,  but i am clearly doing somethign wrondg when trying to add the ID[counter-1] as an expression.  any thouhgts on what i can do differently here?

     

    Frac_0-1674223929105.png

     

     

  • OkanMTL Profile Picture
    703 Super User 2024 Season 1 on at

    Hi,

     

    Yeah so you want to use an expression when enterin the value ID. 

    Here is my example:

    I got an array: 

    The array has the values below: you can see the 6th line has some value that i want to get. to get this value i would  want to retrieve the 6th value from the array which is 5 (0, 1, 2, 3, 4, 5. Has 6 counts, we start from 0).

    OkanAT_0-1674229618214.png

    To input this into a dynamic value this is what I do:

    In the Id field i input the expression = 

    OkanAT_1-1674230300730.png

    the number 5 in your case will be your variable counter.

     

    Can you try this?

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 330

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 123

Last 30 days Overall leaderboard