Append survey123 points to workforce assignments

1640
21
10-16-2018 07:39 AM
joerodmey
MVP Alum

Looking to append my existing survey123 points automatically to workforce as assignments. Can this be done without Python?

0 Kudos
21 Replies
by Anonymous User
Not applicable

Hi Joe,

You don't necessarily need Python. Workforce assignments are stored in a Feature layer. So anything that can add features to a feature layer can accomplish this. That said, Python is the most popular tool used.

0 Kudos
joerodmey
MVP Alum

Aaron,

How would any new point that is created in Survey123 be added to Workforce at the same time? 

Thanks

0 Kudos
by Anonymous User
Not applicable

The two options for that workflow are:

1. Using webhooks with some kind of custom endpoint

2. Polling the survey123 features layer using a script. You'd write a Python (or other language) script that runs every 5 minutes (or whatever interval you decide) on a server. The script identifiers new features and then will create an assignment in the Workforce Assignments layer.

0 Kudos
joerodmey
MVP Alum

What I did was just place the Survey123 feature service in both the worker and dispatcher web maps. Seems to be working that way. Can I trip emails once an assignment has been set to complete, etc?

0 Kudos
by Anonymous User
Not applicable

Not out of the box. You would need to configure a script to poll the assignments feature layer and trigger an email. An example Python script that sends a Slack message is shown here.

0 Kudos
joerodmey
MVP Alum

Integromat an option?

Can data be passed into Workforce to help the field worker understand some details of the request such as what the issue is without the dispatcher typing out the info manually?

0 Kudos
by Anonymous User
Not applicable

I'm not familiar with Integromat so I can't really comment on it.

The mobile app does not support the creation of assignments on device. So you cannot pass in information to create an assignment on device. It must be created using something else first (Dispatcher App, Script, Webhook...).

Most users typically use Workforce as the gateway into the other apps like Collector or Survey123. A Workforce Project can be configured to pass information from an assignment into a Survey123 or Collector form. We currently don't support going the other way around.

0 Kudos
joerodmey
MVP Alum

You mentioned webhooks, how are you suggesting to use those? If I could use the webhook from survey123 to populate assignments in workforce, that would be great.

0 Kudos
by Anonymous User
Not applicable

My understanding is that you configure your Survey form with a webhook that fires when the survey is completed. The webhook (url) that you configure will have to have custom code that handles creating the Workforce assignment. For example, you'd need to configure a web-server that has an endpoint that accepts the feature and creates the assignment. We've prototyped something similar and used AWS Lambda with API Gateway to act as the webhook handlers. If you are using Python, you could create a Flask or Django app that creates the assignment. 

I hope that helps.

0 Kudos