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:
jobExtendedProperty($job, 'incidentreporting', 'shape')
I am trying to do the same with the following:
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?
Solved! Go to Solution.
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.
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
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.
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.
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.
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.