cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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.

 

 

View solution in original post

Highlighted
New Member

Re: Accessing Nested collectio

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

View solution in original post

4 REPLIES 4
Highlighted
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.

 

 

View solution in original post

Highlighted
Super User
Super User

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!

 

Highlighted
New Member

Re: Accessing Nested collectio

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

View solution in original post

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,120)