Select to view content in your preferred language

Remove an entry or item from the dropdown list after it has been picked once..

8346
15
03-09-2017 09:00 AM
HamidYunus
New Contributor III

I am dealing with a situation that requires me to come up with some way to remove the entries/items from a dropdown list after it has been selected or picked once previously. The reason to do this is so that the person doing the survey does not have that entry available to pick it again (either by mistake or on purpose). For example:

Survey has a drop down list with 3 options: A, B, C

- I arrive at Location 1 and Pick A. 

- I arrive at Location 2; my options now should be B and C only.

- I arrive at Location 3; my option now should be C only.

Has anyone done this before?

In my case, the people using the surveys are not tech savvy at all; I cannot ask them to refresh new copies of surveys every day or every so often. They also will have a propensity of making mistakes when it comes to picking from dropdown list, especially in case where the dropdown list contains items that look very similar.

Looking forward to some guidance in this regard. 

15 Replies
DougBrowning
MVP Esteemed Contributor

See my workaround below.

0 Kudos
JamesOsundwa
New Contributor III

Hi guys, I also really need this feature. Users are assigned several (e.g. 30) stores to survey on. Scrolling through the list, they should only see stores that have not been surveyed, rather than the full list of stores. Further, they should see a progress bar of stores surveyed.

by Anonymous User
Not applicable

Hi James, were you able to find a solution to displaying only the stores that have not be selected? 

0 Kudos
JamesOsundwa
New Contributor III

Hi Floyd Bull, unfortunately I was not. I went for a different workflow and accepted it as a limitation of the application :-(.

0 Kudos
DougBrowning
MVP Esteemed Contributor

 James Osundwa   Floyd Bull

I was able to at least simulate this now.  My project has 8 fields all with the same drop down but that only show once the one above gets a value.  A value should never repeat across the 8. 

I cannot remove the choice from the list but I can yell at them if they pick it again.

Use a Constraint that checks the other fields.

Example

Field2 has a constraint of .!=${Field1}

Then just expand

.!=${TopCanopy} and .!=${Lower1} and .!=${Lower2} and .!=${Lower3} and .!=${Lower4} and .!=${Lower5} and .!=${Lower6}

You can even make exceptions with a If (surprised but you can use If in a constraint)

this says if my choice had a XXXX pattern in it then it IS ok to repeat but everything else cannot repeat.

if(not(contains(${Lower1}, "XXXX")), .!=${TopCanopy},1)

What about across repeats?

Harder one where I have a field that does a join() on a repeat to get a list.  I then check my field against this list using contains.  That way I can see if a choice has ever been used across the repeats.  The trick is that the second you pick the last option, it adds to the list, then yells at you.  So for that I did a substr to take off the last 3 chars (since my codes at 3-5 digits) then I do a contains on that substr.  It works great UNLESS a user goes back in a repeat and tries to change a value.  The search will find it and complain.  I just teach my users to delete a repeat and then add a new one at the end.  Was ok for me.  This would be a lot easier if survey had a contains that returns the number of times the string was found not just a yes/no.

With these tricks I was able to get the checks in there that I needed.

Hope it helps.

0 Kudos
RicciLucas
New Contributor III

@IsmaelChivite has this enhancement been done? Can you now remove an entry from or item from your choice list based on a previous question? 

0 Kudos