cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AustinWolf
Frequent Visitor

Compose function failing due to empty array?

Hi All,

 

Until recently, I had a flow set up that would extract data out of a block of JSON code based on changes in an ArcGIS Online hosted service. However, I recently made a couple schema changes to the ArcGIS Online service, and it has apparently broken my flow. I now receive the following error when trying to execute this flow: 

 

Error.jpg

Here is the JSON that is being fed into the compose function, which is an output from a previous tool called "Compose Data" : 

 

 

 

{
  "layerServerGens": [
    {
      "id": 0,
      "serverGen": 458408
    }
  ],
  "transportType": "esriTransportTypeUrl",
  "responseType": "esriDataChangesResponseTypeEdits",
  "edits": [
    {
      "id": 0,
      "features": {
        "adds": [
          {
            "geometry": {
              "rings": [
                [
                  [
                    2601063.17319408,
                    488704.139843589
                  ],
                  [
                    2599666.58703641,
                    483731.535464906
                  ],
                  [
                    2591819.93316971,
                    484954.754910073
                  ],
                  [
                    2591968.02693924,
                    490369.366449302
                  ],
                  [
                    2601063.17319408,
                    488704.139843589
                  ]
                ]
              ]
            },
            "attributes": {
              "OBJECTID": 20,
              "GlobalID": "0175493E-8673-4448-94B2-1BC796F65302",
              "OutageType": null,
              "AlertType": "FP",
              "AlertDetails": null,
              "ScheduledOutage": null,
              "ScheduledServiceRestoration": null,
              "AdditionalResources": null,
              "Status": "I",
              "CustomersAffected": null,
              "InternalComments": "TEst",
              "OutageDetails": null,
              "Division": "SO",
              "Submitter_Name": "Test",
              "CCVerified": "N",
              "CreationDate": 1632488491047,
              "Creator": "lcacoa8813",
              "EditDate": 1632488491047,
              "Editor": "lcacoa8813"
            }
          }
        ],
        "updates": [],
        "deleteIds": []
      }
    }
  ]
}

 

 

 

 

Here is the function that is currently used to extract the data from the "Attributes" section of the JSON:

 

outputs('Compose_Data')?['edits'][0]['features/updates'][0]['attributes']
 
I'm not sure how to properly adjust this function to extract the portion of the JSON I need, so any and all help would be greatly appreciated.
 
Thanks! 
1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @AustinWolf,

 

It looks like the attributes are part of the adds array. So, I would suggest to try this expression instead:

outputs('Compose_Data')?['edits'][0]['features']['adds'][0]['attributes']

 

addsarray.png

View solution in original post

2 REPLIES 2
Expiscornovus
Super User
Super User

Hi @AustinWolf,

 

It looks like the attributes are part of the adds array. So, I would suggest to try this expression instead:

outputs('Compose_Data')?['edits'][0]['features']['adds'][0]['attributes']

 

addsarray.png

View solution in original post

Thank you! That worked perfectly. 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (3,058)