ConfiForms dropdown and multi-select with Other option
Asked by Jane Smith:

I've read this [Vertuna page](https://wiki.vertuna.com/display/TEST/User+macro+to+show+how+to+make+a+ConfiForms+dropdown+field+with+possibility+to+choose+other+option) about creating a User Macro to have a dropdown with the "Other" option that will trigger an open text field. Is there an easier way to do this method? I cannot find the option to create my own User Macro (I think it is on lockdown from my system administrators). I've also never written a macro as described in the Vertuna page. Is it also possible to do this with the multi-select option?


Answers:
author: Alex Medved _ConfiForms_
body: Hi [@Jane Smith](/t5/user/viewprofilepage/user-id/5373594)

This does not have to be a user macro - it is just a bit easier to reuse (in other forms) if you do it as a user macro.

We show that it is just 3 macros

* ConfiForms Definition macro for the dropdown
* ConfiForms Definition macro for the text field to capture "Other" text value
* ConfiForms Rules for Field Definition to show/hide the text field based on the choice made in the dropdown

So, it can very easily be a 3 macros, no user macro is needed

Alex


author: Rayman Bacchus
body: I've used Alex's solution multiple times in one form as I have several multi-select fields all with an Other option. If Other is selected I am supposed to open (show) a text field so the user can provide a detail of what "Other" is defined as

I actually have two rules

Rule MultiselectField:Other then Show Field TextOther  
Rule !MultiselectField:Other then Hide Field TextOther

I use the ! option just in case my user decides to take away the Other option in my multi-select

comments: author: Alex Medved _ConfiForms_
body: Could be done with one rule, as you can set it with "reverse flag" (parameter on the macro). So one rule will actually behave like 2 :-) Saving some configuration time and easier to maintain


author: Joe66
body: Need help. I have the same use case of showing a text field if i select 'Others' option from the multi select dropdown.

The multiselect dropdown goes missing and obviously I can't even choose any of the options for show/hide field to work. Don't know where I'm going wrong.

**confiform field definition macro for multiselect field.**

field name: Choices

field label : choices

field type: multi-select

options:

id - label

1 - choice1

2 - choice2

3 - others

**confiform field definition macro for text field for 'Other' value.**

field name : OtherChoice

field label : other choice

field type: text

**confiform rules for field definition:**

field name : OtherChoice

condition: !Choices:3

action: hide field

actionable field name: Choices

Reverse rule: true


author: Alex Medved _ConfiForms_
body: So, why do you have a reverse rule like that? This doe snot make much sense, logically...

You will need to have a separate rule to show the OtherChoice

One rules with Choices:3 to show and one rule with !Choices:3 to hide

Reverse rule means that ANYTHING but the Choices:3.. that is why it is not suitable for the multi-select fields


author: Joe66
body: I unchecked the reverse rule and defined two rules to show and hide. Got back the multiselect dropdown but the text field isn't displaying when I select 'Others' option.

rule to show:

field name : OtherChoice

condition: Choices:3

action: show field

actionable field name: Choices

Reverse rule: false

rule to hide:

field name : OtherChoice

condition: !Choices:3

action: hide field

actionable field name: Choices

Reverse rule: false


author: Alex Medved _ConfiForms_
body: Certainly works for me

Here is what I have configured for rules macros

![Screenshot 2024-04-05 at 19.08.56.png](https://community.atlassian.com/t5/image/serverpage/image-id/316726i14C928161900407F/image-size/large?v=v2&px=999 "Screenshot 2024-04-05 at 19.08.56.png")![Screenshot 2024-04-05 at 19.08.48.png](https://community.atlassian.com/t5/image/serverpage/image-id/316727iCA0D9A1736A8457F/image-size/large?v=v2&px=999 "Screenshot 2024-04-05 at 19.08.48.png")

Alex


author: Joe66
body: This worked Alex. I had switched 'field name' and 'actionable field name' .

Thank you !!


author: Joe66
body: Hi [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630)

I was testing something and i found out that if i select 'Others' option and enter value 'ABCD' in the textfield and save the confiform, and later on, edit the confiform to deselect the 'Others' option, the text field is getting hidden but the value 'ABCD' is still present in table view macro as it's mapped to the confiform. Basically, it's only hiding the textfield but i also want it to be empty on deselecting the 'Others' option.

Anyway to make it empty ?


author: Alex Medved _ConfiForms_
body: You will need to either use the option in Hide Field rule to reset the value as well

![Screenshot 2024-05-08 at 08.34.11.png](https://community.atlassian.com/t5/image/serverpage/image-id/322492i4998E1B416276F83/image-size/large?v=v2&px=999 "Screenshot 2024-05-08 at 08.34.11.png")

or implement an additional [Reset Value](https://wiki.vertuna.com/display/CONFIFORMS/ConfiForms+Field+Definition+Rules#ConfiFormsFieldDefinitionRules-Resetvalue) rule

Alex


Tags: confiforms

confluence-data-center

data-center