Multi-select validation

Hi,

We need to check for selections made for validation or filtering but it seems I we can’t do formulas on this kind of fielld.
image

If I remember correctly Javascript also does not give us access to the values in the field.

I am not finding any content for this in the community or docs.

Thanks

Hi,

At the moment, it’s not supported to retrieve the values from a multi-select field when writing formulas. You’ll need to change the structure to a subtable and let users input one option in each line. Then, apply formulas from there.

I have to be honest.
That makes this filed type mostly unusable except for display purposes, as you can not use it with logic, reporting or in code. I would suggest warning users not to use this field if they need to be able to perform any functions on the field values.

Making a sub-table is work around and will not always be practical as it makes the forms longer.

Regards

Hi,
multi-select validation , with javascript on pre-workflow .

ezgif.com-gif-maker

Brilliant and please can you share how in JavaScript I can do this.

Thanks you so much

We are considering adding some formulas specific for multiple select fields, such as:

INCLUDES_ALL(‘value1’,‘value2’,…)
NOT_INCLUDES_ALL(‘value1’,‘value2’,…)
INCLUDES_ANY(‘value1’,‘value2’,…)
NOT_INCLUDES_ANY(‘value1’,‘value2’,…)

Let us know if you have some other suggestions on this.

Yes I think this will be good and if we can nest those inside IF() then we can do almost anything. I might for instance want to say

  1. IF includes X and Y but excludes Z as an example

Thanks

Hi Jeff,
Are these formulas for multiple select fields not available yet?

Hi,

It’s not available yet, once it’s supported, we’ll update in this thread.

Retrieving that field on js using getFieldValue() will give you an array. You can use that to validate.

PS. See my next comment.

I did some testing with this. You can javascript to getFieldValue() of a multi-select field. It will be returned as string with commas separating the values. To set the field value, you need to enter the values as one string with a pipe separator

so like this: record.setFieldValue(multiField,“selectionOne|selectionTwo”);

I got this idea from here: https://www.ragic.com/intl/en/doc-kb/119/Importing-into-multiple-selection-fields