Merge an ENUMLIST & Select() into another ENUMLIST

I’m trying merge two lists into a single ENUMLIST so the use can check off various items. So the simplified formula for the suggested value is:

ANY(Select(Table[ENUMLIST],[Something]=TRUE))
+
Select(Table[TEXT],[SomethingElse]=TRUE)

Lets say that ENUMLIST=“a,b,c” and the select function pulls in “1”, “2” and “3”. What I’m seeing is:

a,b,c
1
2
3

whereas I want to see:

a
b
c
1
2
3

I’ve tried wrapping either, both and all in a LIST() equation. If anything that makes them group more.

Anyone have any idea what I’m doing wrong?

Solved Solved
2 14 669
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

Try:

SPLIT(Select(Table[ENUMLIST],[Something]=TRUE), " , ")
+
Select(Table[TEXT],[SomethingElse]=TRUE)

View solution in original post

14 REPLIES 14

Steve
Platinum 4
Platinum 4

Try:

SPLIT(Select(Table[ENUMLIST],[Something]=TRUE), " , ")
+
Select(Table[TEXT],[SomethingElse]=TRUE)

@Steve awesome, that works!

This merge enumlist works great for single text values, however, say I have an enumlist that uses more than one word, for example

This piece of text,Another piece of text,Last/end piece of text

I would like to have a list produced as below

This piece of text
Another piece of text
Last/end piece of text

Are there any workarounds to produce a list like that?

Create a list then display it in the App as an ENUMLIST?

Hi @Ben_Rix

The key-expression in @Steve 's answer is SPLIT, which use " , " as delimiter.
The number of words does not impact the expression, in my opinion.

Did you try it ?

@Aurelien is right. Using SPLIT you get to define the break points. You’re only real issue maybe if you have a string of text with commas in

But if that’s the case you could just CONCATENATE() everything using a different separator, then split by it with SPLIT()

Another good point @Rafael_ANEIC-PY . In an ENUMLIST you can specifiy the separator as well

Yeah ive tried it. I can only get it to separate by a space. Im just trying out a few test runs now with different data to see what the outcomes are.

The results I’m currently getting are:

try

SPLIT(Select(Table[ENUMLIST],[Something]=TRUE), ",")
+
Select(Table[TEXT],[SomethingElse]=TRUE)

(blank spaces around comma: out)

Ive i tried that aswell, blank spaces out. with no luck.

Is the delimiter not the resulting delimiter? Not the determining delimiter.

No idea.

We will have to wait for the mega-master @Steve’s opinion
Unless @1minManager and @Rafael_ANEIC-PY have another idea ?

General advice.

Never touch the Item separator under the EnumList column config. It really makes no sense why AppSheet allows us to change this. It should be automatic based on our language (similar to how .CSV files work)

Since you already did, the best long-term way to solve this is the following:

  1. Go to your EnumList column config and change the item separator to be " , ". You can delete all of the actual content and then make sure to type space - comma - space
  2. Go to your database and replace all the separators that are there in the fields to " , ".
    1. If your data looks like Text 1, Text 2, Text 3 you have to replace ", " for " , "
    2. If it looks like Text 1,Text 2,Text 3 you have to replace "," for " , "; you got the point
  3. After that, you can use @Steve’s expression

Thanks so much for that, it worked!! Really appreciate the help everyone.

Top Labels in this Space