Select to view content in your preferred language

Power Automate to create a record in AGOL FeatureLayer

1376
7
Jump to solution
07-04-2023 07:30 PM
Labels (3)
gis_KIWI4
Occasional Contributor II

Hi, 

We have a sharepoint list that we'd like to replicate in the AGOL via power automate. 

The hurdle for us how do we set up the "Create a record in a feature layer" connector. We have tried passing the "geometry" parameter multiple ways. We have tried -

x,y

AND 

 "geometry": {
"x": 1436052.3270733608,
"y": 5002615.309330223,
"spatialReference": {
"wkid": 2193,
"latestWkid": 2193
}

 

The flow runs fine and creates the feature but with no geometry. 

 

gis_KIWI4_0-1688524052653.png

Anyone used this connector before, that might have an idea? 

Also there is surprisingly low information on these connectors and the format of the inputs they expect. 

0 Kudos
1 Solution

Accepted Solutions
alex_mapintel
New Contributor III

A quick glance at your json object looks like you have 2 opening brackets "{" and only 1 closing bracket "}".

Id try this format:

 

 

{
  "x": 1436052.3270733608,
  "y": 5002615.309330223,
  "spatialReference": {
    "wkid": 2193,
    "latestWkid": 2193
  }
}

 

 

More details regarding Geometry objects can be found in the Developer Documentation at here 

View solution in original post

7 Replies
alex_mapintel
New Contributor III

A quick glance at your json object looks like you have 2 opening brackets "{" and only 1 closing bracket "}".

Id try this format:

 

 

{
  "x": 1436052.3270733608,
  "y": 5002615.309330223,
  "spatialReference": {
    "wkid": 2193,
    "latestWkid": 2193
  }
}

 

 

More details regarding Geometry objects can be found in the Developer Documentation at here 

gis_KIWI4
Occasional Contributor II

Thanks @alex_mapintel , I copied the code incorrectly. It had the brackets. 
It also didn't like the keyword "geometry" in the code. 

What worked for us was the below - 

{
  "x": 1436052.3270733608,
  "y": 5002615.309330223,
  "spatialReference": {
    "wkid": 2193
  }
}



OR 



{
  "x": 170.8504403060537,
  "y": -45.360211429819564,
  "spatialReference": {
    "wkid": 4326
  }
}

 Thanks again. 

 

AnninaRupe1
New Contributor III

Thanks for this solution!

Also, in case anyone else is having trouble with this, just copy/paste the code directly into the "Geometry" bar--not the f(x) bar in the Expression window that appears when you click in the "Geometry" bar.

0 Kudos
DanielArsenault
New Contributor III

I have issues with this same thread, looking for help on this one, record gets created fine but no geometry in the new record .... anybody's help is appreciated :).

0 Kudos
DanielArsenault
New Contributor III

Well I figured it out, no need to dig further.  

0 Kudos
AnninaRupe1
New Contributor III

I had to work with Esri to get this situated. I've included a screenshot of the Power Automate workflow.
In "Parse JSON," in "Content" I had to put the Current item from the "For each 3" step and under "Schema," I had to paste the following:

{
    "type": "object",
    "properties": {
        "attributes": {
            "type": "object",
            "properties": {}
        },
        "geometry": {
            "type": "object",
            "properties": {}
        },
        "changeType": {
            "type": "string"
        }
    }
}

 

Then, in the "Create a record in a feature layer" step, under "Geometry," open the "Insert function" box and then click on the Dynamic content tab in that box. This will give the option to choose and add "Body geometry" from Parse JSON.

I think that should make it work.

0 Kudos
DanielArsenault
New Contributor III

ah yes that's good, thanks for sharing.  Below is how I achieved the result.

0 Kudos