List from values in a row

Hello there!

I had a form with 3 columns [ID] [text] and [enumlist] both ([text] and [enumlist]) are blank and the enumlist allowed other values.
When I open this form and add some values in the [text] column with “,” separeted for each value, after save the form and reopen it is it posible to extract those values into the enumlist of this form?

What I´m trying to achieve is a sort of Cheklist with the values that are entered in the [text].

Solved Solved
0 28 794
1 ACCEPTED SOLUTION

One option could be to write a valid_if expression (for the user input in text column) to invalidate poorly formatted comma-separation.

AND(
    NOT( CONTAINS( [_This] , " , " ) ),
    NOT( CONTAINS( [_This] , " ," ) ),
    NOT( CONTAINS( [_This] , ", " ) )
    )

…or somesuch

View solution in original post

28 REPLIES 28

Steve
Platinum 4
Platinum 4

This will split words from a frase.
How can I add those words into an ENUMLIST?

Try, in valid_if field of [enumlist], enter in SPLIT( [text] , “,” )

All ready try it and is not showing more than one option, and also is not allowing to select the enumlist

Please provide screenshots.

Solve it.
It was missing the “,” in the [text]

Hello @Marc_Dillon

I discovered something that I think is wrong.
Your expression works, but when I select some value from the EnumList and sync the App, it duplicates the selected values in the EnumList.
How can I fix this?

I’m sorry I’m not real sure how that could happen. Is your text column somehow dependent on the selections of your enumlist? Do you have anything in the enumlist’s suggested values field? Do you have other features setup that are somehow related to this?

Here is how it works: I have [text] where I enter words or frases separeated with a “,” so the [enumlist] could list all the values from [text], and it works, but when I select some option from the [enumlist] and sync, it still adding the values of [text], so values in [enumlist] after sync are duplicated. How can avoid this?

Shoot. I remember having this exact issue and I don’t remember how I fixed it… Let me stare at my app for a bit and see if it comes to me.

It would be great!

I think I ended up restructuring my data. But for a different reason.

I’m pretty sure it had to do with item separation mismatches.

You indicate that you are separating with a comma and no spaces on either side. And thus, you are splitting by that same comma with no spaces.

This is slight conjecture from my memory, I might be wrong…

However, if there actually is a space on either side of the comma, this ends up happening because while AppSheet knows it’s valid data, there ends up being a mismatch because of the floating space that never got deleted. OR, it is also possible that this is happening because (per your screenshot) the EnumList has no item separator listed for how it should store them in the spreadsheet. This should match how you are setting up you comma separated text column.

So try that.

I will check on this

It seems that you have a grate memory!
Thanks a lot! Solve it!

Was it spaces around the comma, or the item separator for the EnumList?

Both.
It should not be spaces around comma and it should go comma as a separator in the EnumLisy

Excellent.
3X_0_8_08cf49fe4164d49e889d166fe2fb701b80538808.gif

So the expression to avoid any mistake from the user, avoiding the spaces around comma should be something like this?

SPLIT([AgregarTareas],TRIM(" , "))

Not quite.

SPLIT( TRIM( [AgregarTareas] ) , “,” )

…well, maybe not. This probably wouldn’t get rid of spaces around commas inside a long string. I was just wanting to make you aware of that expression in case it was helpful in some way here.

Yep, just try it and is not working

You’d have to TRIM the user input. However, that doesn’t solve the problem if the user does ", " some of the time, and “,” others, since TRIM would assume that space is fine.

To completely idiot-proof the user input you’ll probably want to employ the usage of IFS, CONTAINS, TRIM and SUBSTITUTE. You have to manually account for each and every possible silly thing a user could enter (like multiple commas) and correct it’s formatting so you can use it. This is precisely why a comma separated text column is not a good solution for user input.

Yep, a simple way to make idiot-proof is to add a explanation in the row “please add frases with no space between commas”

Users will completely disregard on-screen instructions if they can still continue along. So you would at least need to prevent them from saving with bad data. Like @Marc_Dillon just posted.

One option could be to write a valid_if expression (for the user input in text column) to invalidate poorly formatted comma-separation.

AND(
    NOT( CONTAINS( [_This] , " , " ) ),
    NOT( CONTAINS( [_This] , " ," ) ),
    NOT( CONTAINS( [_This] , ", " ) )
    )

…or somesuch

Bahbus
New Member

I have a bigger question to ask you though. Why are you using a text column as input in the first place? Instead of using an EnumList right off that bat? Then you wouldn’t even need to worry about formatting issues.

Good question!
I´m making a maintenance App for a hospital, and they add daily duties, and thouse daily duties have some sub duties, where each of thouse sub duties, have specific tasks (1 or more than one), and this tasks are most of the time, new tasks where the user wants to add it as it goes. So when the user finish a sub task must click on the task that is finished

Yep, this is a good solution to

Top Labels in this Space