Initial Value for Enum List

Hi,

I have an Enum list that looks up Company Name by useremail and then presents those companies for selection where a user is part of the company. I would like to set an Initial Starting Value so that the field is not blank when the form is opened. It doesn’t matter at this time which value (company) is populated as long as the user belongs to the company which is already accomplished in the Valid If section.

Make the Initial value an expression that produces a list of values. You could use the exact same formula as you use in Valid If to auto-select all the choices:

SELECT(Users[Company Name], [Email] = UserEmail())

Or, you could preselect the first of the valid choices by wrapping that expression with TOP():

TOP(SELECT(Users[Company Name], [Email] = UserEmail()), 1)

See also:

Hi Steve,

I actually tried this before I posted to the forum but got this error: The expression is valid but its result type ‘List’ is not one of the expected types: Enum.

Am I missing something?

Yep, your column isn’t an EnumList. Use ANY() instead of TOP():

ANY(SELECT(Users[Company Name], [Email] = UserEmail()))

See also:

Perfect! Thank you, Steve.

1 Like