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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (897)