cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GAK
Level: Power Up

Accessing Nested collectio

In a PowerApp, I have a collection of Outlook Contacts with an email column that has a nested/group collection for email addresses.  However, I can not figure out the syntax to return the nested email address as text versus being returned as a table type so I can use the email (as a text) in 'RequiredAttendees' section of the CalendarPostItems call.  

 

    Collection name is "MyPeople" 

             "MyPeople" column name is "EmailAddresses" 

                    "EmailAddresses" Nested/Group Collection name is "EmailAddresses" 

                                 Column name is      "Address"                    and        "Name"

                                                             john.doe@email.com                 john.doe@email.com

 

Thanks in advance for the help.  

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Accessing Nested collectio

Hi @GAK

Supposing that you want to return the first row from MyPeople and the first child row from EmailAddresses, the syntax you would use would look something like this:

First(First(MyPeople).EmailAddress).Address

Rather than use the First function, you can use the Lookup function instead to lookup a row more specifically based on criteria.

 

 

GAK
Level: Power Up

Re: Accessing Nested collectio

Thanks for the help!  I got it working now...

4 REPLIES 4
Super User
Super User

Re: Accessing Nested collectio

Hi @GAK

Supposing that you want to return the first row from MyPeople and the first child row from EmailAddresses, the syntax you would use would look something like this:

First(First(MyPeople).EmailAddress).Address

Rather than use the First function, you can use the Lookup function instead to lookup a row more specifically based on criteria.

 

 

seadude
Level 10

Re: Accessing Nested collectio

Couple little items to add here that might be helpful... When your collection has data nested even further (2 layers deep), you can add another First() function to access.
Example: First(First(myCollection.data1).data1).data2).data2

If you are using Custom Connectors to return JSON and you find unnecessarily nested data, you can adjust the Custom Connectors Response to strip the leading JSON off and just return the "level" of data you need.

Take care!

 

GAK
Level: Power Up

Re: Accessing Nested collectio

Thanks for the help!  I got it working now...

Highlighted
Super User
Super User

Re: Accessing Nested collectio

Wahoo! Just found another way to "peel" off layers of JSON from a Custom Connector response.

The response itself allowed one dot-notation "layer". Then wrapped the Connector itself in a First() function. Peeled off two layers as part of the call!

ClearCollect(colCustomConnectorResponse,
    First('customConnector'.connectorAction({param1: ThisItem.whatever, param2: ThisItem.whatever2}).firstLayerOfJSON).secondLayerOfJSON
)

Hope you find this useful!
   

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 166 members 5,073 guests
Please welcome our newest community members: