Enum list from enum list

Hi,

I think this may have been covered before but I have a list of counties in an outlet app that a user can assign to themselves. The reason for this is that the security filter is used to only search the database in the counties that have selected. This means that the app is much faster as it doesn’t search data that is not in the counties selected. These counties are made up of an enumlist of a column in my administrator table. I allow them to view certain counties and they in turn filter those one to only the data they want to see/search at that time.

This works fine. But I also have a map and list search funstion where they search outlets by type, rating and county. The enumlist is taken from the counties they have selected to assign themselves. As this is taken from an enumlist itself I end up with and enumlist of an enumlist.

Rather than a column being used it is the contents of a cell that shows this below for example.

Aberdeenshire , Avon , Berkshire , Cheshire , Cumbria , Dorset , East Sussex , Essex , Hampshire , Kent , Lancashire , London , Merseyside , Middlesex , Surrey , North Yorkshire , Somerset , West Sussex , West Yorkshire , Wiltshire , Shropshire

Is there a way I can turn the above into an enumlist

Thanks

Phil

Hi @Phil_Waite,

May I request you to try following. I believe you are having expression in the in the second Enumlist’s ( Used for Map) valid_if such as( Table 1[Enumlist 1] ) Where Enumlist 1 is selected counties’ list.

If so ,may I request you to try SPLIT((Table 1[Enumlist 1]), “,”) in the valid_if of second Enumlist that you are using in Map related filtering?
Edit: made some changes to the suggested expression.

1 Like

Hi Suvrutt,

I have tried this but it doesn’t create an enumlist

SPLIT(SELECT(Users[Counties Allowed], [User Id]=USEREMAIL()), " , ")

thanks

Phil

I believe you will need to insert an ANY() function to return the SELECT value as TEXT rather than as a LIST of 1 item. LOOKUP() instead of ANY(SELECT()) would work well also.

SPLIT(ANY(SELECT(Users[Counties Allowed], [User Id]=USEREMAIL())), " , ")

1 Like

What does it create?

In my own testing, it creates a List rather than an EnumList. A List should work just fine for your need.

1 Like

Hi @Steve ,

Thank you.

Hi @Phil_Waite,

In my testing also, the suggested format had created a list that works well in valid_if

Could you please update what results you are getting.

Hi,

With this below expression and all others I have tried I get the same result in the attached screen shot.

SPLIT(ANY(SELECT(Users[Counties Allowed], [User Id]=USEREMAIL())), " , ")

thanks

Phil

At least you should use “,” instead of " , " with your SPLIT() expression.

4 Likes

That worked!!

SPLIT(ANY(SELECT(Users[Counties Allowed], [User Id]=USEREMAIL())), “,”)

Thank you

Phil

2 Likes