Restrict choice if NONE selected

Hi all,

I have an enumlist allowing multiple colour choices with the following options:

  • Green
  • Blue
  • Orange
  • Yellow
  • Purple
  • None

If you select 1 or more colours it is fine however:

Is there a way to restrict or show a valid_if error when:

None + any other option is chosen? eg. None, Purple

I want to make sure that when the user chooses NONE, they dont accidentally match with a colour.

thanks in advance

@Jethro
You can use this expression in the Valid_if property of your enumlist column

AND(
	TRUE,
	NOT(
		IN(
			"None",
			[_THIS]
		)
	)
)

and you can set a definitive text for the Invalid value error property

1 Like

@LeventK Thanks for this. Unfortunately it shows the error anytime I select NONE. I was looking at a method that if I select NONE + another value it shows the error. NONE on its own is fine.

Is there something else i could try?

@Jethro
Then you need to try with this:

AND(
	COUNT(SPLIT([_THIS],","))>=2,
	NOT(
		IN(
			"None",
			[_THIS]
		)
	)
)
1 Like

Thanks again. I dont think it is possible with this method as I want to allow the choice of only one colour as well. The formula forces 2 choices minimum. Not sure how to solve this one :frowning: Challenge.

Is there a way to evaluate the following logic?

If count is > 1 then make sure NONE is not one of the values chosen?

@Jethro

IF(
	COUNT(SPLIT([_THIS],",")) > 1,
	NOT(
		IN(
			"None",
			[_THIS]
		)
	),
	TRUE
)
1 Like

@LeventK Hero!! It was literally staring me right in the face! Once again, thanks for this!! :100::boom:

You’re very welcome @Jethro