cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kosenurm
Post Partisan
Post Partisan

Parsing an array of arrays....

Hi, 

 

I need a bit of help please. 

 

I have a flow whereby I need to parse a JSON in order to get the values within the "values" element of the JSON. 

 

The values part is an array of arrays, so I am then trying to loop through each object in here to update Dataverse.

 

However, before I get this far, I am setting a variable to ensure that I am getting the correct list of objects for values. Every time I run this, however, the output is empty/null. But there is data in there. What could I be doing wrong?

 

What would the correct output of the Parse JSON command be in order for me to see the items within 'values'?

 

{
    "type": "object",
    "properties": {
        "statusCode": {
            "type": "integer"
        },
        "headers": {
            "type": "object",
            "properties": {
                "Transfer-Encoding": {
                    "type": "string"
                },
                "Vary": {
                    "type": "string"
                },
                "Strict-Transport-Security": {
                    "type": "string"
                },
                "request-id": {
                    "type": "string"
                },
                "client-request-id": {
                    "type": "string"
                },
                "x-ms-ags-diagnostic": {
                    "type": "string"
                },
                "OData-Version": {
                    "type": "string"
                },
                "Timing-Allow-Origin": {
                    "type": "string"
                },
                "x-ms-apihub-cached-response": {
                    "type": "string"
                },
                "x-ms-apihub-obo": {
                    "type": "string"
                },
                "Cache-Control": {
                    "type": "string"
                },
                "Date": {
                    "type": "string"
                },
                "Content-Type": {
                    "type": "string"
                },
                "Content-Length": {
                    "type": "string"
                }
            }
        },
        "body": {
            "type": "object",
            "properties": {
                "@@odata.context": {
                    "type": "string"
                },
                "@@odata.type": {
                    "type": "string"
                },
                "@@odata.id": {
                    "type": "string"
                },
                "address": {
                    "type": "string"
                },
                "addressLocal": {
                    "type": "string"
                },
                "columnCount": {
                    "type": "integer"
                },
                "cellCount": {
                    "type": "integer"
                },
                "columnHidden": {
                    "type": "boolean"
                },
                "rowHidden": {
                    "type": "boolean"
                },
                "numberFormat": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "columnIndex": {
                    "type": "integer"
                },
                "text": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "formulas": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "formulasLocal": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "formulasR1C1": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "hidden": {
                    "type": "boolean"
                },
                "rowCount": {
                    "type": "integer"
                },
                "rowIndex": {
                    "type": "integer"
                },
                "valueTypes": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "values": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    }
}

 Thanks

K.

2 REPLIES 2
MaleselaR
Frequent Visitor

Hi @Kosenurm 

I notice that "values" isn't the only array of arrays so I assume you can't access those either. If you want to "use/extract" every value is to use 2 nested apply to each actions, or if you know which element in both arrays you want to access you could use something like variables('variable name')[body][values][0][1] with "0" and "1" being the array indices

eliotcole
Super User
Super User

Hi, @Kosenurm, I had thought we'd covered this over on the previous thread, mate.

 

I think ... first of all ... that your Parse JSON action has the wrong schema set to it. Perform the previously discussed action on a file that you know has some data on the pages, and then paste the returned JSON into the schema builder.

 

However ... I would also advise you to do like I'd mentioned there ... instead of using the parse JSON, use a simple call directly to the values field.

deletable.jpg

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,894)