cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
zdames
Level: Powered On

How to extract a row from a collection within a collection.

Hi everyone, I'm working on a POC that extracts data from an API,

 

now whenever I get my data, it results into a collection within a collection (APICollect is the collection, 'd' is a column that contains the 'results' record). As shown:

Capture.PNG

I believe you can get the row of a collection inside a collection, but in this case, it's 3 layers of collections. I was hoping to extract these set of data only. Tried searching through discussions but wasn't able to find answers and it's making me go crazy! Man LOL 

 

Appreciate everyone's help! 🙂

4 REPLIES 4
Super User
Super User

Re: How to extract a row from a collection within a collection.

Hi @zdames

APICollect is a collection that can contain multiple records and I assume that your API call only  returns a single row. Therefore, something on the lines of the following should return your child collection:

First(APICollect).d
Super User
Super User

Re: How to extract a row from a collection within a collection.

Hello zdames,

I agree with timl.
First(APICollect).d will return the data.
In order to select a specific record you can use the First , Last and LookUp functions.
Examples:

First(First(APICollect).d)
Last(First(APICollect).d)

LookUp(First(APICollect).d,ID=2)                 (If the there is an ID column)

 

Edit: I can see that there is also an extra nested table called results,
You can try the following to return the first record of the results table:
LookUp(LookUp(LookUp(APICollect,true,d),true,results),true)


You can change ,true, to a condition like ID=2, to retrieve the record that you need.
LookUp(LookUp(LookUp(APICollect,true,d),true,results),ID=2) or an other example
LookUp(LookUp(LookUp(APICollect,GUID="21321323fdgdfg21321321321",d),true,results),ID=2)


zdames
Level: Powered On

Re: How to extract a row from a collection within a collection.

Thanks for the tip @timl! But unfortunately this only goes one step lower in my nested collection and wasn't still able to dig deeper. I need to atleast get to the 'results' table after 'd'

Super User
Super User

Re: How to extract a row from a collection within a collection.

Hi @zdames

Sorry for not getting back to you sooner. @Mike8s suggestion looks as though it should work. 

LookUp(LookUp(LookUp(APICollect,true,d),true,results),true)

Did you ever resolve this problem?

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,197)