I have a column that is an Enum type that dis...

expressions
(Joe Birk) #1

I have a column that is an Enum type that displays images in my app. I am using an expression in another column similar to “Contains([Front Head Type],“blah”)” that performs some calculations based on the Enum selection.

The images are all stored in the drive folder and end in .jpg. No problems getting them to display however, the enum columns [Front Head Type] & [Rear Head Type] are referenced in the display name of other columns as well as in a workflow. I would like to get rid of the file type “.jpg” in the string. I’ve looked through the documentation and tried the following without any success.

In App: SUBSTITUTE([Front Head Type],".jpg","")

In Workflow: <<SUBSTITUTE([Front Head Type],".jpg","") >>

Error messages state “Parameter 1 of Substitute is used incorrectly”, any idea how i can modify the string to remove “.jpg” as is not relevant to anyone using the app or workflow but simply part of the file name used in the enum?

(Reza Raoofi) #2

I believe SUBSTITUTE requires a text column type, whereas your Enum’s BaseType is image; try something like this; it should work:

SUBSTITUTE(TEXT([Front Head Type]), “.jpg”, “”)

(Joe Birk) #3

Yep, that was it, Thank you Reza!

(Reza Raoofi) #4

You’re welcome!

(Grant Stead) #5

@Joe_Birk working with some exchangers there I see!

(FREDY ORTEGON) #6

I would like to know how to make an enum with images ?. I understood that they could be text only

(Joe Birk) #7

@Grant_Stead, good eye!

@FREDY_ORTEGON, here is a sample app for using images in an enum list.

appsheet.com - Images in buttons - How to use images in Enum buttons Images in buttons - How to use images in Enum buttons appsheet.com

(Grant Stead) #8

@Joe_Birk I’ve managed plenty of refinery turnarounds, so I know all about tearing into some exchangers!

(FREDY ORTEGON) #9

@Joe_Birk thank you!!!