Select to view content in your preferred language

Geocode Addresses not working in flow

2822
10
Jump to solution
09-10-2023 12:50 PM
Rob_Hughes_32Alpha
Regular Contributor

Hello all,

I am trying to develop a flow to pull data from a client's Salesforce into Dataverse, transform it in Power Query, geocode the addresses and finally add them to a feature layer. We are currently stuck on the prototype phase where we are trying to get the geocode addresses action to work. The flow says it has completed successfully, and the records are added to the table in the feature layer, however the geocoding does not work. We get the following error message:

{"statusCode":200,"headers":{"ETag":"W/\"b6-7KYDAKFLNQPidja/ILX7vS1s/M8\"","X-Powered-By":"Express","Timing-Allow-Origin":"*","x-ms-apihub-cached-response":"true","x-ms-apihub-obo":"false","Date":"Sun, 10 Sep 2023 18:18:08 GMT","Content-Length":"182","Content-Type":"application/json; charset=utf-8"},"body":{"message":"Requested addresses are not valid. Check the input: 56 Horseshoes Way, Brampton, Huntingdon, Cambridgeshire, PE28 4TN and try again.","success":false}}

 The address geocodes perfectly well in this format using AGOL. I don't understand why it is not accepting the address!

Does anybody have any ideas? Or can somebody from Esri please let me know if this is a known bug, or whether there are any particulars I have to do with the data format to get it working?

Thanks!

0 Kudos
1 Solution

Accepted Solutions
SeanKMcGinnis
Esri Contributor

@Rob_Hughes_32Alpha - thank you for the call today, I am glad we were able to get it sorted out.

For others who may be encountering a similar issue, the issue was the projection of the data was not defined.

The way we resolved it was by including the spatial reference details as part of the geometry JSON. The result looked like:

{"x": [Longitude (X)], "y": [Latitude (Y)], "spatialReference": {"wkid":4326}}

 

[Longitude (X)] & [Latitude (Y)] representing the dynamic content  returned from the geocode address action and the WKID value representing the correct projection.

-sean
Sean McGinnis - ArcGIS for Microsoft 365 Product Manager

View solution in original post

10 Replies
SeanKMcGinnis
Esri Contributor

Good Day @Rob_Hughes_32Alpha 

In looking at the screenshot, it appears you are using the 'Geocode addresses' action. If you are trying to geocode a single record, try using the 'Find address candidate' action. I used the address you shared as a test and it returned coordinates that appear to match the address in the map.

SeanKMcGinnis_0-1694435873347.png

I hope this helps and please let me know if you have any additional questions.

 

-sean
Sean McGinnis - ArcGIS for Microsoft 365 Product Manager
0 Kudos
Rob_Hughes_32Alpha
Regular Contributor

Hi Sean,

Thanks for your reply. I take it that Geocode Addresses is used for batch geocoding only then? That's good to know.

I have actually tried using Find Address Candidates as well, and while it does successfully generate a Lat Long, and it updates the records on the feature layer table, it does not plot them so they are not visible on the map. Do you know why this is? I have tried loads of combinations within the Geometry field but primarily and most often the Lat Long results Find Address Candidates produces. I feel like I'm missing something really obvious!

0 Kudos
Rob_Hughes_32Alpha
Regular Contributor

I've attached the action setup and results from the test if it helps!

0 Kudos
SeanKMcGinnis
Esri Contributor

Hi @Rob_Hughes_32Alpha ,

When adding the geometry, try constructing it as a JSON representation of geometry. 

{"x": [Longitude (X)], "y": [Latitude (Y)]}

The [Longitude (X)] & [Latitude (Y)] would be the dynamic content  returned from the geocode address action.

-sean
Sean McGinnis - ArcGIS for Microsoft 365 Product Manager
0 Kudos
Rob_Hughes_32Alpha
Regular Contributor

Ahh sorry, I double checked and now it is plotting them on the map but at 0.000000000, 0.0000000000.

0 Kudos
SeanKMcGinnis
Esri Contributor

@Rob_Hughes_32Alpha - can you show what was input into the create record action?

-sean
Sean McGinnis - ArcGIS for Microsoft 365 Product Manager
0 Kudos
Rob_Hughes_32Alpha
Regular Contributor

Sure - see attached. I also attached the output for the geometry field.

0 Kudos
SeanKMcGinnis
Esri Contributor

@Rob_Hughes_32Alpha  - please send me an email at smcginnis@esri.com and we can try to set up a conversation. Will be easier than bouncing screenshots back and forth.

Look forward to hearing from you.

-sean
Sean McGinnis - ArcGIS for Microsoft 365 Product Manager
0 Kudos
Rob_Hughes_32Alpha
Regular Contributor

Have sent you an email. Thanks for your help.

0 Kudos