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

Solved Solved
0 7 483
1 ACCEPTED SOLUTION

@Jethro

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

View solution in original post

7 REPLIES 7

@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

@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]
		)
	)
)

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 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
)

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

Youโ€™re very welcome @Jethro

Top Labels in this Space