I know you can call Survey123 from Collector or Navigator. Is it possible to launch a specific form from Workforce and pass information like the asset ID or any other relevant info I would want to carry over to Survey123? Say I want our mobile workers to receive assignations in Workforce (on their worker maps) and launch a specific form in Survey123 when they select a layer from the map inside Workforce. I know this method works quite well in Collector, but what about in Workforce? BTW - Many thanks to Ismael Chivite and James Tedrick for their fantastic contents on GeoNet
This should work for both classic and offline enabled projects.
Hi Aaron,
assignment_to_add.feature.attributes["qythours"] = assignment[args.qythours_field]
Is this still valid for a version 2 project?
Thanks.
Hi Paul,
The app integrations are quite resilient. I would recommend testing the scheme for launching Survey123 using Collector or Explorer first. Just add the assignments layer into a web map and configure the popup to launch Survey as you like. When working as you expect, then use the Python API to add the integration. If you do encounter problems, you can alway use the ArcGIS Online assistant and remove the integration from the project item.
Jeff
Hi Aaron
I am considering this as a solution to pass fields from workforce to survey123. I am just wondering if there was any pitfalls or risks associated with using it that you are aware of , as it is not fully supported via the workforce website.
Flawless.
Thanks Aaron!
assignment_to_add.qythours = assignment[args.qythours_field]
I think this is the line that won't work. The "assignment_to_add" object is an Assignment and it only has specifically defined properties
If you want to do this, I think you'll have to go to the feature level like:
I haven't tried it, but I'm pretty sure it will work.
Aaron Pulver
Aaron, I'm using your workforce automation scripts to populate a project.
I'd like to add a custom field, in this case, 'hours', to assist with scheduling.
I've tried modifying the script to allow this (I've already added the field qtyhours to the layer), but am having little success.
I should add I'm not a coding expert but have some understanding.
# Set the hours if args.qtyhours_field and assignment[args.qtyhours_field]: assignment_to_add.qythours = assignment[args.qythours_field]
parser.add_argument('-qtyhours-field', dest='qtyhours_field', help="The field that contains the Hours")
The code executes, but does not collect the quantity of hours from the csv file.
One thing you can do right now, is add additional fields to your assignments layer. For example, you could add a field named "assetName". If you are creating your assignments automatically using scripts or whatever, then you would be able to populate this field (it currently won't show up in the Workforce Dispatcher Web Application). Then you can add a custom integration to survey123 which can be opened directly from the Workforce Mobile App. In the next release of the Python API (1.5), we have added an integration manager to the Workforce Module, this makes it easier to add custom integrations.
In the following example, I've added a new field titled "assetName" and then added an integration that passes this field directly to survey123 field named "field_0". The integration looks like:
{'id': 'survey123-custom', 'prompt': 'Open in Survey123', 'urlTemplate': 'arcgis-survey123://?itemID=a7d9a4895dc744feae0269d2cd43773a&field:field_0=${assignment.assetName}'}
Example code, using the new integration manager is available here: workforce-scripts/UC 2018 - 1 - Configuring A Project.ipynb at master · Esri/workforce-scripts · GitHub
You can also add custom integrations (beyond what you can do in the Web App) by editing the project json manually in AGO Assistant.
Also I have the same issue, I want to pass specific attributes from assets into Survey123 form, it should be doable due to worker map can configure popups. The benefits will expand if we can populate assets details from Workforce directly.
Hi Craig,
What I would like to do in fact is to call a specific form in Survey123 from the Workforce worker map; so when the workers start their assignment by selecting what they have on the map, a pop-up windows would appear (with the Custom URL parameters embedded passing values to Survey123 -- ideally in a related table representing the inspections linked to an assets layers). Collector do this in a wonderful way...so I was hoping to have the same functionality within a web map in Workforce. Here is what it would look like:
I hope to have stated my problem more clearly. I know the Esri mobile apps allow some very tailored workflows and the one I'm looking for is solely about Workforce--Survey123. Please, don't hesitate if you need more details.
Thanks,
Jimmy
Jimmy,
Workforce supports launching Survey123 at the Project or Assignment Type level; the doc taking you through these steps is available here:
FAQs for project owners—Workforce for ArcGIS | ArcGIS
Tips for project owners—Workforce for ArcGIS | ArcGIS
This allows information to be passed from a Workforce Assignment to Survey123.
However, it sounds like you would like link Survey123 to a specific feature in a feature layer in the Worker web map and pass information from that feature to the Survey.
You mention in your first post the need to pass AssetID, are there other fields that you'd like to pass?
Craig
Hi Jon,
In fact, I just want to know if we can pass field parameters via the URL scheme under Workforce to Survey123. It's a way to shorten a specific workflow, not being force to use Collector to execute this, so by example, a survey will be related to a parent feature class directly from Workforce (specifically the worker map in our case). Thanks.
Updates: After having done some tests, it doesn't work. Workforce cannot pass field parameters to Survey123 via a custom url shceme. Can someone prove me wrong?
Hi Jimmy,
What I do is to launch the settings for the project, advance and app-integration. There I can set up the survey I want the workforce to work up with, and you can transfer relevant information.
Is this what you are looking for?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.