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!
Solved! Go to Solution.
@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.
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.
I hope this helps and please let me know if you have any additional questions.
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!
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.
@Rob_Hughes_32Alpha - can you show what was input into the create record action?
@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.
Have sent you an email. Thanks for your help.