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

Solved Solved
0 8 517
1 ACCEPTED SOLUTION

That worked!!

SPLIT(ANY(SELECT(Users[Counties Allowed], [User Id]=USEREMAIL())), โ€œ,โ€)

Thank you

Phil

View solution in original post

8 REPLIES 8

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.

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())), " , ")

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.

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.

That worked!!

SPLIT(ANY(SELECT(Users[Counties Allowed], [User Id]=USEREMAIL())), โ€œ,โ€)

Thank you

Phil

Top Labels in this Space