Can successfully SPLIT .png or .jpeg from image file name in EnumList

I found the test app “Images in Buttons” in one of the topics. It uses images as buttons in an EnumList. For my purposes it will allow users that can’t read, to make their choice based on the image rather than text. However, for users that can read, I do want a text output below that confirms their image based choice. (See screenshot)

In order to make it look more clean, I am trying to remove the .png or .jpeg from the image file name. But I am failing to do so for an EnumList. The current expression (for the column called “Choice”) reads:

TEXT([Choice])

It shows all choices made but with the .png ending.

Applying this expression:

INDEX( SPLIT([Choice], “.”), 1)

…takes care of removing the .png or .jpeg, but it leaves me with only one result, even when I pick multiple choices (as is possible in EnumList).

Could someone please help me with the expression, so that it would for the example in the screenshot, output: “Check, Lightbulb”?

Thank you!

Solved Solved
0 4 446
1 ACCEPTED SOLUTION

You are welcome.

Please try

SUBSTITUTE(SUBSTITUTE(TEXT([Choice]), “.PNG”,"") , “.JPEG”,"")

I am sorry that I should have shared help article on SUBSTITUTE()

AppSheet has rich documentation at Customer Support - AppSheet and please search by keywords.

View solution in original post

4 REPLIES 4

Do you wish to remove the extension from the image file names? Then those may not display as image files?

Or do you wish to remove the extensions from the message column that displays selections?

Presuming you wish to remove from the message column, please try

SUBSTITUTE(TEXT([Choice]), “.PNG”,"")

Thank you very much Suvrutt! I wasn’t aware of the SUBSTITUTE expression yet.

You are right, I wanted to remove the extension from the message column. This worked exactly as required.

If I may, how do I adjust the expression to be flexible to remove either .PNG or .JPEG?

Thank you again!

You are welcome.

Please try

SUBSTITUTE(SUBSTITUTE(TEXT([Choice]), “.PNG”,"") , “.JPEG”,"")

I am sorry that I should have shared help article on SUBSTITUTE()

AppSheet has rich documentation at Customer Support - AppSheet and please search by keywords.

Works like a charm. Thank you for your excellent advise. Have a great rest of the week!

Top Labels in this Space