You are viewing limited content. For full access, please sign in.

Question

Question

Hide some values in a drop-down

asked on April 15, 2021

I have an existing business process that relies heavily on the value selected in a drop-down field in a form.  The drop down values are actually user account names.  There are 4 values in the drop down.  My client now wants me to only show 2 of these values if a user selects 'No' in another, previous field. 

The options available in my existing drop down are

Mary (value = maryusername)

Joe (value = joeusername)

Ahmed (value = ahmedusername)

Shahera (value = shaherausername)

 

So, if PreviousField selection = 'No'

Then, in the drop down, only show

Mary (value = maryusername)

Joe (value = joeusername)

 

Is this possible and, if so, how would I go about it.  Any ideas welcome, I don't want to have to change my rather complex business process.

0 0

Answer

SELECTED ANSWER
replied on April 19, 2021

Thank you both for your help.  In the end, I took a different route that is working well.

The problem was that I needed to keep my variable name the same or I would have to re-write my processes. 

What I did was created 2 different drop downs with different names and different variables (Dropdown1 and Dropdown2.)  Only one of these would appear on the form depending on if the user selected Yes or No to another field.

Then I created a single line field and applied the original variable name (originalvariable) to it.  In the Advanced tab of this new single line field, I used the Concatenate function to default the value of the single line field to a concatenation of dropdown1 and dropdown2. 

=CONCATENATE(dropdown1, dropdown2)

Because only one of those dropdown variables will contain a value in any given instance of the form I end us with the single line field with my original variable showing the value that I want - and I don't have to edit all the processes.

It works very well.

 

 

3 0

Replies

replied on April 16, 2021

Is this in Forms or Web Access/Win Client?

And, what does the "no" value refer to?

I'm asking because I would tend to make a generic process. It maybe 4/2 values now. It may be 100/50 next year.

 I would load all of the values into a database table and then create a stored procedure to return just the two values when the previous field says "no." A field rule would then be used to populate the dropdown.

Another option would be to use two different drop-down and show one or another depending on if the previous value says "no" but that would mean a change to your business process, or javascript to copy the select result to variable currently used by your business process. I prefer to avoid javascript and go with a database (and store procedure scripts) and find maintaining back-end customisation easier.

-Ben

1 0
replied on April 19, 2021

If it's as simple as this, you could duplicate the one drop down field and make one of them have the two choices.  Then hide the two fields except when the Yes No field has been filled in.  If Yes, the one drop-down shows up.  If No, the other drop-down shows up.

If its more complicated than this and you have just given a short version to get the idea across, you might need a hidden SQL list to pull the options in from based on a choice in the Yes No field.

I'm sure this could be done with JavaScript, as well, but I'm not familiar enough with that.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.