Hello! I'm trying to do something that I thought was possible, but I'm having some trouble getting it to function correctly.
I created a new Workforce Project, then added some custom attributes to the "Assignments" layer to capture some additional information about the assignment. Once I added the additional attribute fields, I created a survey in Survey123 Connect based off this existing feature layer (assignments). My plan was this: Set up the Survey123 App Integration with Workforce. When the worker opens his/her assignment, he/she can fill out the usual information that Workforce allows, then click the "survey at assignment" button, launch the survey, then add the additional attribute information via Survey123. What I'm finding is that when I launch the "survey at assignment" and submit the survey information, another feature is added to the assignments layer instead of editing the current feature. I've tried adjusting the URL parameters in the "Assignment Integrations" table, as I've done with Collector/Field Maps to open a survey to edit attributes, but to no avail. Nothing I've tried to adjust seems to be permitting me to add data to the additional attributes in the assignment layer. It just keeps adding new features in the assignments feature layer.
My question is this: Is it possible to use the Survey123 Integration from the Workforce assignment to update custom attributes about the assignment feature? In other words, I want to add data to the custom attribute fields for the Workforce Assignment feature that the worker is currently viewing in Workforce.
I have no problems launching Survey123 to edit attributes of an existing feature in Field Maps or Collector, and I wouldn't think this would be significantly different. One difference I see is that when I set this up in Collector/Field Maps, I design my URL parameters to open the Survey123 web form, not the Survey123 app. One reason for this is that in order to edit the existing attributes of a feature using the survey, it has to be opened up in edit mode ("mode=edit" in the URL Parameters), and I believe that the Survey123 app does not support this functionality. So another question could be: Can you open the Survey123 web form, instead of the Survey123 app, from Workforce? Looking at the URL parameters in the Assignment Integrations table, it is set by default to open up in the Survey123 app, indicated by the beginning part of the URL parameter of https://survey123.arcgis.app?. I'm wondering what would happen if I change the beginning of the URL reference to https://survey123.arcgis.com/share/ .
Any help/suggestions would be appreciated. Thanks.
Tyler
Solved! Go to Solution.
Tyler,
Yes, it is possible to change the url scheme that Workforce uses to call Survey123 to launch the web form instead of the mobile app. You can hand edit the url scheme in the Assignment Integrations table. Here's an example:
https://survey123.arcgis.com/share/<itemID>?mode=edit&globalid={GlobalID}
However, be aware that, since you're editing the same assignment feature in Workforce as you are in Survey123 - in order for this workflow to be successful - before opening Survey123 any outstanding edits to the Assignment must be sync'd first.
And, once returning to Workforce - you need to perform another sync to ensure that you Workforce has the latest edits you made from Survey123 perform you make any edits to the assignment in Workforce.
If these syncs aren't performed, you risk overwriting or losing data.
You'll want to walk through this workflow and ensure there's no data being overwritten.
Tyler,
Yes, it is possible to change the url scheme that Workforce uses to call Survey123 to launch the web form instead of the mobile app. You can hand edit the url scheme in the Assignment Integrations table. Here's an example:
https://survey123.arcgis.com/share/<itemID>?mode=edit&globalid={GlobalID}
However, be aware that, since you're editing the same assignment feature in Workforce as you are in Survey123 - in order for this workflow to be successful - before opening Survey123 any outstanding edits to the Assignment must be sync'd first.
And, once returning to Workforce - you need to perform another sync to ensure that you Workforce has the latest edits you made from Survey123 perform you make any edits to the assignment in Workforce.
If these syncs aren't performed, you risk overwriting or losing data.
You'll want to walk through this workflow and ensure there's no data being overwritten.
Thanks for your response! While I was waiting for a response to my initial post, I did some experimenting with changing the URL parameters to open the web map, just as you described above, and it seems like it's working. However, there is a bit of variation to the syntax that you listed above in order to make it work. It looks like this:
https://survey123.arcgis.com/share/<ItemID>?mode=edit&globalId=${assignment.globalid}
I received an error stating that the GlobalID parameter was not property defined if I just used the "globalId={GlobalID}" syntax. I can try to reset the URL parameters and generate the error if you need a screenshot.
In my preliminary testing, I did discover the issue with syncing that you mentioned above. That prompts a question: Is there a way to "disable" the offline capability of Workforce with this new version so that syncing is not required? Or is that built in now in such a way that it cannot be disabled? That will be really annoying for the field worker if they have to keep re-syncing the assignment every time they make edits. I don't really need the offline editing capability in my situation, and it would be an advantage if I could disable it. The ability for offline editing is also causing an issue with my worker map - I have an image service that doesn't appear to be compatible with syncing, and if that image service is in the map it does not display properly. That's another issue I have to resolve. Thanks for all your help!
Tyler,
Your syntax is correct, the example I gave was for another project where the GlobalID was being passed in. In your case, you can reference the assignment.globalid since you're editing the same feature.
"Is there a way to "disable" the offline capability of Workforce with this new version so that syncing is not required?"
"That will be really annoying for the field worker if they have to keep re-syncing the assignment every time they make edits."
Craig
Craig,
Thanks for the explanation and your fast responses. One additional question:
If the worker makes edits (either in Workforce or to the integrated survey) and immediately closes the app, when does Workforce sync? The next time they open the app?
One other thing I did notice when I changed the URL parameters to open the web app in edit mode - The Workforce project settings page is showing an error for the Survey123 app integration. See the screen shot below:
I don't know if this will really be an issue or not, but it does tell me that the URL scheme for the web app in edit mode is technically "not supported."
Tyler,
"If the worker makes edits (either in Workforce or to the integrated survey) and immediately closes the app, when does Workforce sync? The next time they open the app? "
"One other thing I did notice when I changed the URL parameters to open the web app in edit mode - The Workforce project settings page is showing an error for the Survey123 app integration. See the screen shot below"
Craig
Craig,
Regarding "closing the app" - Yes, that's what I mean. Kill the app by swiping up on iOS or choosing the "recently used apps" button on Android and ending all applications. Our workers do NOT leave any ArcGIS field apps (Workforce, Field Maps, Survey123, etc) open on their devices. It kills the battery life of the device. So they make it a habit of doing what they need to do, then closing the app. But you answered my question. In my case, theirs should sync edits when they open the app up again, which is problematic, if I'm trying to see what they've done from the office. They might not open it back up for hours. So they'll have to add that extra "manual sync" step before they close so the edits will be synced as soon as they finish editing. That's something I could see being easily forgotten by field staff...
Thanks again for your help Craig. I consider this matter answered and closed.
Tyler,
Happy to help. FWIW - we are planning to support the editing of additional fields in both the web and mobile apps, once the Workforce capability is added to Field Maps. That should really simplify this workflow. We're currently planning that work for later this year.
"So they'll have to add that extra "manual sync" step before they close so the edits will be synced as soon as they finish editing. That's something I could see being easily forgotten by field staff"
Craig
Craig,
That's good news - supporting the editing of additional fields in a simpler manner. I think that will really make Workforce more broadly useful, especially for situations like mine where we HAVE to collect additional information about each work order. I'm actually planning on using Feature Reports in Survey123 to take this workflow one step further and generate a "Work Order Report" PDF that highlights the work that was completed for each work order/assignment. In our scenario, we have to report work of a certain assignment type to higher level of government, so I'll use Integromat to watch this feature layer for features of that assignment type that are completed. When they are, I can have it automatically run a workflow to generate the feature report and upload it to our cloud servers. Then we will have it ready when it's time to send the report up the chain. It would be nice to bring that Feature Report service into Workforce. I think a work order report is probably a common requirement. Maybe I'll see if that's in the ideas section.