How to use EnumList to create a list of email address (in one column)?

I am creating a Bot.  I want to include a list of comma separated email address (user defined) in the CC: field.  I am trying to achieve this by having an EnumList which the user adds required email addresses to.

This assumes that the system will handle a list of email addresses in the CC: field, and that the list should be comma separated. eg  "user1@email.com,user2@email.com"

In the Bot > Process > Send an Email task > Customer Template > Settings > CC: > Expression I have the following Select expression, which returns an error in the editor "The expression is valid but its result type 'EnumList' is not one of the expected types: Email".  This is despite the Base Type of the EnumList is Email.

What is the correct approach to my use case?  How can my current solution be adjusted or should I start again (and how)?

SELECT(
  referenceData_groups[membership_coordinator_email],
  ([_THISROW].[Group] = [group_long_name]),
  TRUE
)

where membership_coordinator_email is defined:
Type: EnumList
Values: <blank>
Allow other values: TRUE
Auto-complete other values: TRUE
Base type: Email
Input mode: Auto
Item separator:  ,

Thanks in advance.

Solved Solved
0 3 108
1 ACCEPTED SOLUTION

I think the expression you have evaluates to a list of lists ({[enum],[enum],...}).

Enclose the expression with ANY() or INDEX() to obtain a single ENUMLIST.

View solution in original post

3 REPLIES 3

I think the expression you have evaluates to a list of lists ({[enum],[enum],...}).

Enclose the expression with ANY() or INDEX() to obtain a single ENUMLIST.

Does using the following expression help

SPLIT(TEXT(SELECT(
  referenceData_groups[membership_coordinator_email],
  ([_THISROW].[Group] = [group_long_name]),
  TRUE
)), " , ")

@TeeSee1 , @Suvrutt_Gurjar  thank you for the amazingly fast reply.

@TeeSee1 , I went with your solution in the end - and it seems so very obvious that it was a "list of lists" now you point it out.  I applied ANY() and resolved the problem.

Top Labels in this Space