I use the following expression to convert text with spaces and/or commas into lists where the spaces and commas both function as separators (that is, are all converted to " , "):
list(substitute(substitute([Tags],","," , “),” “,” , "))
This expression converts the following kind of user generated text
donyuen money extra,spaces more money
into the following kind of list
donyuen , money , , , extra , , , spaces , more , money
So far, so good. Now for the problem: Expressions that modify lists do not work directly on this expression. So, for example,
unique(list(substitute(substitute([Tags],","," , “),” “,” , ")))
does not eliminate the second use of “money” and
sort(list(substitute(substitute([Tags],","," , “),” “,” , ")))
doesn’t sort.
However, if the same expression, that is
list(substitute(substitute([Tags],","," , “),” “,” , "))
is used by itself in a “list” column called “Tags to list” then
unique([Tags to list])
properly produces
donyuen , money , , extra , , , spaces , more
and
sort(unique([Tags to list]))
produces
, , , , donyuen , extra , money , money , more , spaces
Could LIST() be made to be truly equivalent to a list column?
P.S. I would like users to be able to tag items so that they can then choose from a list of tags to display all items with that tag in a slice. So, users need to be able to type in tags but I don’t expect them to always obey formatting rules. I want all spaces and commas to be treated as separators for this reason.
User | Count |
---|---|
40 | |
34 | |
29 | |
23 | |
17 |