Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Confiforms: How to check multi-select field to see if user selected a specific value

I have a form with a Smart Multi-Select field configured. I want to show or hide another field based on the user selection in this field.

First Form

Has the following field

USER_SEL_TOOLS (Smart Multi-Select field)

 

Second Form

Has the following fields

TOOL_NAME (Text field)

TOOL_ATTRIBUTES (Multi-Select field)

 

example record

|     TOOL_NAME     |    TOOL_ATTRIBUTES     |

|     hammer        |    wood, metal        |

 

I want to build a conditional statement for a Confiforms Rules for Field Definition that looks to see if the user selected "hammer" and if "hammer" has the attribute "wood" selected. If this is true, then perform action.

I can get the select values from TOOL_ATTRIBUTES:

[entry.USER_SEL_TOOLS.TOOL_ATTRIBUTES.getOptions] 

Returns "wood metal" when testing by setting the value of a text field. However, I can't seem to get the CONDITION to evaluate and the action to execute: 

[entry.USER_SEL_TOOLS.TOOL_ATTRIBUTES.getOptions]:*wood*

 

2 answers

Hi

The better option would to use hasValue function - https://wiki.vertuna.com/display/CONFIFORMS/Virtual+functions

TOOL_NAME.TOOL_ATTRIBUTES.transform(label).hasValue(wood):true

As your condition might give a false positives if "TOOL_ATTRIBUTES" is for example "wooden", but you wanted to check strictly against the "wood"

Alex 

I set condition to the following and that worked:

TOOL_NAME.TOOL_ATTRIBUTES.transform(label):*wood*

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

Marketplace Partner Spotlight: Fine Software

Happy New Year, everybody! What better way to kick off 2022 than with a new Marketplace Partner Spotlight ✨ This month, we're getting to know Daniel Franz, co-founder of Fine Software. Fine Software ...

429 views 2 15
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you