cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

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 III
Super User III

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.

 

 

View solution in original post

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

View solution in original post

4 REPLIES 4
Super User III
Super User III

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.

 

 

View solution in original post

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!

 

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

View solution in original post

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,489)