Select to view content in your preferred language

Removing item from dropdown list as survey gets submitted?

196
3
12-11-2024 07:06 AM
RachelS
Frequent Contributor

Hi all,

 

I'm wondering if this is possible in Survey123.

We have a survey that has about 30 say vehicles in a drop down list. The user selects a vehicle fills in some info on it then submits the survey.

Is it possible for that vehicle to drop of the list once it's been submitted, so when the user goes back into the survey the list is getting smaller and smaller?

To further complicate things I could have multiple users and ideally they wouldn't see the vehicles that have dropped off the list. I don't know how that could work when everyone downloads the survey to their own device.

The survey would then need to reset at say midnight with all the vehicles back on the list for the next day.

Any ideas, much appreciated.

Rachel

0 Kudos
3 Replies
MobiusSnake
MVP Regular Contributor

Nothing "off-the-shelf" like this, as far as I know.  I think you'd need to start with something like this:

https://community.esri.com/t5/arcgis-survey123-blog/dynamic-choice-lists-using-search-appearance/ba-...

You'd need to extend it in such a way that when a record is submitted with one value, that sets a flag on that value so its no longer returned in future search() results.  For example, a "used" field on your lookup table that defaults to 0, gets set to 1 when submitted, and have your search() filter set to something like "used = 0".

The trick will be flipping that zero value to a one.  I can think of a few ways:

  • A webhook that checks the values of submissions, then edits your lookup table.
  • A scheduled notebook that does the same (downside here is a delay between submissions and having the value dropped from the list).
  • It might be possible with a hosted feature layer join, where your submissions and LUT are in the same hosted feature service (this might be more of a null vs. not null thing though).  I generally avoid these joins but this could be a good use case.

None of these are foolproof though, like if two users are working on a survey simultaneously, they could pull the same values off the list.  This is especially an issue if users will have drafts hanging around for a while.  Also, search() won't work at all if you need to do offline surveys.

A couple of different approaches you could take:

  • If you assigned vehicles to people in advance, you could generate records that appear in their inboxes, with those vehicle values locked in place.  This would guarantee one record per vehicle.  This would also allow you to work offline.
  • A dashboard that shows a list of vehicles that haven't had surveys submitted yet, with links to launch Survey123 and auto-populate the vehicle.  This wouldn't work offline, and there's still a small risk of two users selecting the same vehicle concurrently, but I think this is a more elegant/simple solution than an approach using search(), webhooks, etc.
abureaux
MVP Frequent Contributor

I can maybe think of one way to do this. But it is far to convoluted to lay out in detail. Short answer is that isn't supported at this time.

This sounds like the Inbox may be more useful to you. If you haven't considered that feature yet, that may be a more reasonable solution.

RachelS
Frequent Contributor

Thank you @MobiusSnake and @abureaux for your replies.

As I thought it's not very straightforward at all. I'll look into your suggestions.

Regards

 

Rachel

0 Kudos