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

Nested Arrays in a Custom Connector -- can't access children below level 3

I've built a custom connector that returns an object with three layers of nested arrays (see the example below). 

 

When defining the connector's response using 'import from sample', it doesn't show any of the fields in the third nested array ('issues') in the UI. However, it does show up in Swagger editor, which confirms that it has been captured. 

 

When looping through the arrays in Flow, I'm able to get to the point of looping through the 'issues' array, but I can't access any of the fields in the child objects. 

 

Any thoughts as to why? Is there a limit to how deep custom connectors will look into nested arrays? Is there another way to access the children of a custom connector, besides using 'Apply to each' on each nested array?

 

Response Sample: 

 

 

 

{
    "id": "1a797e87-9bfc-4ff0-8a50-7a81a81bda19",
    "project_id": "0e02977b-4c7d-47f3-85ac-581a6810cfca",
    "created_at": "2019-10-30 11:36:30 -0400",
    "sections": [
        {
            "section_name": "",
            "items": [
                {
                    "id": "beb90fbd-e431-45fb-a9ab-21f77708d29c",
                    "created_at": "2019-10-30 11:37:47 -0400",
                    "issues": [
                        {
                            "id": "f8c5d8d6-8192-45a4-acf4-e847d8d8da98",
                            "description": "The building is finished ",
                            "identifier": "000006"
                        }
                    ]
                }
            ]
        }
    ]
}

 

 

 

 

What this produces in Swagger Editor: 

 

 

 

      responses:
        '200':
          description: success
          schema:
            type: object
            properties:
              id: {type: string, description: id}
              project_id: {type: string, description: project_id}
              created_at: {type: string, description: created_at}
              sections:
                type: array
                items:
                  type: object
                  properties:
                    section_name: {type: string, description: section_name}
                    items:
                      type: array
                      items:
                        type: object
                        properties:
                          id: {type: string, description: id}
                          created_at: {type: string, description: created_at}
                          issues:
                            type: array
                            items:
                              type: object
                              properties:
                                id: {type: string, description: id}
                                description: {type: string, description: description}
                                identifier: {type: string, description: identifier}
                            description: issues
                      description: items
                description: sections

 

 

 

 

What this produces in the UI:

image 1.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Nested Arrays in a Custom Connector -- can't access children below level 3

Hi @adsk_dc,

 

The template language expression cannot be evaluated because property 'sections' cannot be selected. Array elements can only be selected using an integer index. So the only way to extract the level 3 child element of the nested array, you need to use Apply to each.

 

Or you can remove these "[]" in the array, and then parse JSON for it. 

[
{
    "id": "1a797e87-9bfc-4ff0-8a50-7a81a81bda19",
    "project_id": "0e02977b-4c7d-47f3-85ac-581a6810cfca",
    "created_at": "2019-10-30 11:36:30 -0400",
    "sections":
        {
            "section_name": "",
            "items":
                {
                    "id": "beb90fbd-e431-45fb-a9ab-21f77708d29c",
                    "created_at": "2019-10-30 11:37:47 -0400",
                    "issues":
                        {
                            "id": "f8c5d8d6-8192-45a4-acf4-e847d8d8da98",
                            "description": "The building is finished ",
                            "identifier": "000006"
                        }
                }
        }
}
]

 Annotation 2019-11-04 104548.png

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Nested Arrays in a Custom Connector -- can't access children below level 3

Hi @adsk_dc,

 

The template language expression cannot be evaluated because property 'sections' cannot be selected. Array elements can only be selected using an integer index. So the only way to extract the level 3 child element of the nested array, you need to use Apply to each.

 

Or you can remove these "[]" in the array, and then parse JSON for it. 

[
{
    "id": "1a797e87-9bfc-4ff0-8a50-7a81a81bda19",
    "project_id": "0e02977b-4c7d-47f3-85ac-581a6810cfca",
    "created_at": "2019-10-30 11:36:30 -0400",
    "sections":
        {
            "section_name": "",
            "items":
                {
                    "id": "beb90fbd-e431-45fb-a9ab-21f77708d29c",
                    "created_at": "2019-10-30 11:37:47 -0400",
                    "issues":
                        {
                            "id": "f8c5d8d6-8192-45a4-acf4-e847d8d8da98",
                            "description": "The building is finished ",
                            "identifier": "000006"
                        }
                }
        }
}
]

 Annotation 2019-11-04 104548.png

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,730)