cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mmattar
Responsive Resident
Responsive Resident

Lookup a collection

Hello all,

 

I have a collection that holds up to at least 10 records, i need to lookup a row and grab a data from one column of that row and store it into a variable. This is possible with First and Last, but how do i get records that are the 2nd, 3rd, 4th etc..

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User III
Super User III

@mmattar 

To get a value from the 2nd row of a collection and store it in a variable you would do this

Set(myVariable, Last(FirstN(your_collection_name, 2)).your_fieldname)

 

To get a value from the 5th row of a collection and store it in a variable you would do this

Set(myVariable, Last(FirstN(your_collection_name, 5)).your_fieldname)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

1 REPLY 1
mdevaney
Super User III
Super User III

@mmattar 

To get a value from the 2nd row of a collection and store it in a variable you would do this

Set(myVariable, Last(FirstN(your_collection_name, 2)).your_fieldname)

 

To get a value from the 5th row of a collection and store it in a variable you would do this

Set(myVariable, Last(FirstN(your_collection_name, 5)).your_fieldname)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (4,386)