ConfiForms Multi Select Field & Filter Not Working as Necessary
Asked by Rayman Bacchus:

I currently have a MULTI-SELCT dropdown field with 6 options

|----|-------------|
| 01 | Prevent     |
| 02 | Detect      |
| 03 | Response    |
| 04 | Performance |
| 05 | CIAM        |
| 06 | Integration |

I then have show fields filter based on the id's above

Show certain fields if 01, 02, 03, 04, 06 are selected

Show other fields if 05 is selected

The issue I have is that if I choose option 02 first then 06 all fields show as required

However, if I select 06 first THEN 02 the required fields for option 02 are not showing up.

See the screen shots below:

Shows Correct

**Option 2 is selected and the fields show as required**

![iMAGE001.png](https://community.atlassian.com/t5/image/serverpage/image-id/316354i4076372E70711CC8/image-size/large?v=v2&px=999 "iMAGE001.png")

**Options 2 and 6 are selected and the fields show as required**

![Image002.png](https://community.atlassian.com/t5/image/serverpage/image-id/316355i8CFB7B126A94377C/image-size/large?v=v2&px=999 "Image002.png")

**Options 6 then 2 are selected but the fields do not show up**

![Image003.png](https://community.atlassian.com/t5/image/serverpage/image-id/316356i066AAD318F7B8A07/image-size/large?v=v2&px=999 "Image003.png")

I am using the Filter: Option.id.hasValue(01):true OR Option.id.hasValue(02):true OR Option.id.hasValue(03):true OR Option.id.hasValue(04):true OR Option.id.hasValue(06):true


Answers:
author: Alex Medved _ConfiForms_
body: Hi [@Rayman Bacchus](/t5/user/viewprofilepage/user-id/4958603)

Reading your requirements I think the correct filtering expression would be

```
!Option:05
```

Alex

comments: author: Rayman Bacchus
body: That didn't work. My filter works if you select option 2 then option 5 everything works as expect and the fields show as required.

If you select option 5 first then option 2 the fields do not show up


author: Alex Medved _ConfiForms_
body: Not sure I understand...

I have suggested my solution to handle this
> Show certain fields if 01, 02, 03, 04, 06 are selected
>
> Show other fields if 05 is selected

Alex


author: Alex Medved _ConfiForms_
body: BTW, this makes no sense

```
Option.id.hasValue(01):true
```

You can ask the multi-select field (Option) to have a value, not the ID

```
Option.hasValue(01):true?
```


author: Rayman Bacchus
body: The issue is if all 6 options are selected not all fields show up.

So if I select options 1, 2, 3, 4, 5, 6 in that order all fields show up but if I select option 5 first then option 1, 2, 3, 4 and 6 some fields are still missing. I'll remove the id in the filter and see if that works.


author: Alex Medved _ConfiForms_
body: Sounds like you are having conflicting rules - do you use 'reverse rule' option in the rules macro?


author: Rayman Bacchus
body: Thanks. I was thinking that it had to be my rules just not sure what or where it is conflicting. I don't have reverse rule option applied but I will review and try that.


author: Alex Medved _ConfiForms_
body: If you can use the storage format then I can share some working logic for this scenario (as much as I understand it)

```
<ac:structured-macro ac:macro-id="5eab593d-2812-4ee3-93b7-3d164dc17a42" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">form</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="944adc99-e4b9-4d20-aa0c-ea491a2337c5" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="formName">form</ac:parameter>
<ac:parameter ac:name="type">Embedded</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="180e25a8-6c5e-4f5f-adfc-e7c0ac83b6d1" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">Option</ac:parameter>
<ac:parameter ac:name="fieldLabel">Option</ac:parameter>
<ac:parameter ac:name="values">false[01=Prevent|02=Detect|03=Response|04=Performance|05=CIAM|06=Integration|]</ac:parameter>
<ac:parameter ac:name="type">multi</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="14ea97fa-8122-4dc6-b94e-c3344304d1d0" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">field1</ac:parameter>
<ac:parameter ac:name="fieldLabel">Field1</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="7cd7e9f3-e612-475e-8a40-54bbf3693b54" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">field2</ac:parameter>
<ac:parameter ac:name="fieldLabel">Field2</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="8c35fc01-4103-431d-84ef-7a75b5721321" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">field3</ac:parameter>
<ac:parameter ac:name="fieldLabel">Field3</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="f0772a22-5e32-49fa-9e65-337a82947e21" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">Option:[empty]</ac:parameter>
<ac:parameter ac:name="fieldName">field1,field2,field3</ac:parameter>
<ac:parameter ac:name="action">Hide field</ac:parameter>
<ac:parameter ac:name="actionFieldName">Option</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<p>
<ac:structured-macro ac:macro-id="2d3ebb43-f47d-49ba-9d55-d33f39b541dd" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">Option:05</ac:parameter>
<ac:parameter ac:name="fieldName">field3</ac:parameter>
<ac:parameter ac:name="action">Show field</ac:parameter>
<ac:parameter ac:name="actionFieldName">Option</ac:parameter>
<ac:parameter ac:name="withReverseRule">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<p>
<ac:structured-macro ac:macro-id="8cca1c08-2993-4ab6-a660-7cd9b205e7eb" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">Option:01 OR Option:02 OR Option:03 OR Option:04 OR Option:06</ac:parameter>
<ac:parameter ac:name="fieldName">field1,field2</ac:parameter>
<ac:parameter ac:name="action">Show field</ac:parameter>
<ac:parameter ac:name="actionFieldName">Option</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="7fdfef3e-6c3f-4f13-86ae-6d1dfe89c0b7" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">!Option:01 AND !Option:02 AND !Option:03 AND !Option:04 AND !Option:06</ac:parameter>
<ac:parameter ac:name="fieldName">field1,field2</ac:parameter>
<ac:parameter ac:name="action">Hide field</ac:parameter>
<ac:parameter ac:name="actionFieldName">Option</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
```

Hope it helps. Basically 4 rules to solve all possible selections

Alex


author: Rayman Bacchus
body: I was able to solve this as it was indeed conflicting rules. Rules can be difficult sometimes to deal with! ;)

I'm all good now and will accept the answer. Thanks again for all your valuable feedback and insight


Tags: confiforms

confluence-data-center

data-center

filter

multi-select