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.

 

 

View solution in original post

GAK
Level: Power Up

Re: Accessing Nested collectio

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

View solution in original post

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.

 

 

View solution in original post

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

View solution in original post

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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 356 members 5,362 guests
Please welcome our newest community members: