Define Location from Survey123 Polygon in Workflow Manager

885
9
Jump to solution
01-12-2023 11:36 AM
bbaker_tngeo
New Contributor III

I am trying to use the Define Location Step after a Survey123 Step. I have tried using a survey with a geoshape question (name=location) with method=vertex as the body::esri:style and then with a geopoint question (field name = location)

In the Designing Advanced Workflow video of the Workflow Manager learning plan, @JFarmer did this exact thing with a point question using the following in the Geometry location method:

bbaker_tngeo_0-1673551923005.png

 

jobExtendedProperty($job, 'incidentreporting', 'shape')

I am trying to do the same with the following:

bbaker_tngeo_1-1673552026437.png

 

jobExtendedProperty($job, 'testpointproject', 'shape') with 'testpointproject' being the name of the survey added. Is 'shape' the name of the geopoint/geoshape question, or is that pulling from the shape geometry of the feature layer? Either way, I keep getting an error "Failed to save location" when the Define Location Step runs. 

Am I missing something with the Arcade expression?

0 Kudos
1 Solution

Accepted Solutions
JFarmer
Esri Contributor

@bbaker_tngeo 

A public AGOL survey should work in this case. I think at this point, you'd need to take a look at the Workflow Manager Server logs and see what is corresponding to the Failed to Save Location message in the UI. You can likely leave them set to warning and get something useful but it's possible they may need to be set to debug and combed through if there isn't a useful warning message.

View solution in original post

0 Kudos
9 Replies
JFarmer
Esri Contributor

Hi @bbaker_tngeo 

Nice to see you're trying out something we went over in the learning plan!

Your expression looks fine so that leads me to think it's not that. Have you added the Survey123 feature layer as an extended properties table in your job template? The expression relies on that table existing.

As for shape, that's the geometry field from the feature service. It doesn't need to be the question name.

Jonathan

0 Kudos
bbaker_tngeo
New Contributor III

Thanks for the response @JFarmer, the videos have been really helpful learning Workflow Manager from the ground up! 

I tried adding it as an extended property but was confused as to whether the survey name in the expression was coming from the Extended Property or the Reference Name in the Survey123 Step. I have confirmed that I added the Survey123 Form as an Extended Properties table and tried defining the area from the form again and I am still getting the "Failed to save location" error. I don't know if it makes a difference, but I am testing this workflow with a public Survey123 form in an AGO account and not in the Portal that WM is running in.

0 Kudos
JFarmer
Esri Contributor

@bbaker_tngeo 

A public AGOL survey should work in this case. I think at this point, you'd need to take a look at the Workflow Manager Server logs and see what is corresponding to the Failed to Save Location message in the UI. You can likely leave them set to warning and get something useful but it's possible they may need to be set to debug and combed through if there isn't a useful warning message.

0 Kudos
bbaker_tngeo
New Contributor III

Thanks @JFarmer,

I was able to narrow down the issue to the client's GIS server not having https://survey123.arcgis.com in the list of Allowed Origins. Once we added it to the list, I am now able to publish a survey in their Portal and Define Location based on the survey. 

That led to another question, though. Is it possible to associate attached documents/images to a Survey with the job itself? I am thinking in terms of a workflow where an administrative staff receives a site plan/sketch of a work request to initiate a job, and then again when an inspector using Survey123 as their inspection form wants to upload photos to the job. Currently, those attachments aren't showing up on the job details pane so I am wondering how they can be linked or attached to the job.

0 Kudos
NurFarahHannanAhmad
New Contributor II

Hi @bbaker_tngeo , @JFarmer ,

 

I'm also currently having the same issue. I've enabled the https://survey123.arcgis.com in the Allowed origins in the portal setting. However in the server admin, the setting for the allowed origins is already wildcard(*), so i don't think adding the link to the setting would rectify the issue.

 

In the server log, I got below information.

NurFarahHannanAhmad_1-1701332355598.png

Appreciate if you guys can let me know if there is any other possible configuration that need to be updated to rectify the issue.

Thanks.

 

Regards.

0 Kudos
JFarmer
Esri Contributor

@NurFarahHannanAhmad 

I notice some unexpected message errors in the logs, that generally means there is more information at the Verbose or Debug level. I'd set the logs to Debug, try again, and see if there is some helpful information there to troubleshoot with.

Jonathan

0 Kudos
NurFarahHannanAhmad
New Contributor II

Hi @JFarmer ,

 

Thanks for the response. I tested the workflow and select the debug for the log and got below result. I tried to search for more info based on the error message, however there is not much info available. Do you have any suggestion on this?

 

NurFarahHannanAhmad_1-1701415820795.png

Thanks.

 

0 Kudos
JFarmer
Esri Contributor

@NurFarahHannanAhmad You would be looking for an error (none of those messages are errors or issues to be concerned about).

The easiest way to do this is to try to make sure no one else is using the server, get to the point where you are ready to reproduce the issue (like right before), delete all the server logs, reproduce the issue, and immediately query the logs. At that point, it may take some digging to find an issue. Tech Support could be a good help here to assist with that part as I know there are a lot of messages to sort through at the debug level.

If the issue is running the Define Location step, then you can search for messages around starting that step (you'll need to know the step ID which you can get on the diagram for that workflow). Then follow the messages from there to see if and what error(s) are logged.

Jonathan

0 Kudos
JFarmer
Esri Contributor

@bbaker_tngeo 

Currently the Survey123 step itself doesn't have a way to get attachments from the survey and attach them to the job. But there is a way to do it. You'll need to create a geoprocessing service that gets the attachment from the Survey123 feature service and then calls our API to add the attachment to the job. You would then call this GP service from the Run GP Service step as part of your workflow.

You can use the Job class in the Python API and add_attachment for our part of it: https://developers.arcgis.com/python/api-reference/arcgis.gis.workflowmanager.html#job

0 Kudos