Set an initial ENUM type to a music time signature like 4/4

Hey All,

I am building a music app that has time signature choices as ENUM type.  I'd like to set the INITIAL VALUE to the ENUM for 4/4 as it's the most common.  However, using "4/4" leads AppSheet to interpreting it as a STRING type and complains.  Using '4/4' as suggested in the error message, leads to AppSheet interpreting it as a DATE type! 

I tried the programmatic way of escaping  the "/" with a "\" (ie. '4\/4'), but of course that didn't work either - it includes the "\" character and appears to add it to my list...

       KGingeri_0-1708055930569.png

Is there a way to do this? 

(I just add to this that I tried Unicode characters and although they work, they are much smaller and hard to see)

Solved Solved
0 6 107
1 ACCEPTED SOLUTION

Please try an initial value expression of 

CONCATENATE("4","/","4")

This is assuming the enum column has base type as text.

View solution in original post

6 REPLIES 6

Please try an initial value expression of 

CONCATENATE("4","/","4")

This is assuming the enum column has base type as text.

Well that's crazy because I tried other String functions and they didn't work, but that did! 
Thanks much @Suvrutt_Gurjar !!  😊

Actually the base type as defined in my AppSheet DB (if I understand the question) is ENUM not String.  But concatenate() worked as you can see below...

KGingeri_3-1708063167782.png

 

 

You are welcome @KGingeri .

 

 


@KGingeri wrote:

Actually the base type as defined in my AppScript DB (if I understand the question) is ENUM not String.  But concatenate() worked as you can see below...


 

Hi @KGingeri , 

I noticed this sentence just now. I believe you mean AppSheet DB and not AppScript DB.

By base type I mean the setting  highlighted below. An enum or enumlist column can have different base types such as long text, text, image etc.

Suvrutt_Gurjar_0-1708066405698.png

Hope this helps.

 


@Suvrutt_Gurjar wrote:

I noticed this sentence just now. I believe you mean AppSheet DB and not AppScript DB.


Indeed!  Good catch.  I have done my share of "AppScript" programming. So my ol'brain doesn't separate them well! 😂  (I'll edit it after I reply here)


@Suvrutt_Gurjar wrote:

By base type I mean the setting  highlighted below. An enum or enumlist column can have different base types such as long text, text, image etc.


Oh!  I do forget about that little pencil Icon and all the settings hidden there! 

KGingeri_0-1708068909422.png

Wow - there are a lot of "Base Types"!  Thanks for that bit of education as well!
I'm finding this community very responsive and helpful!! 😁 👏

Just an after thought here...
I'm not sure why other string functions wouldn't work then. 
For instance I had tried TRIM("4/4") and it didn't as well as just "4/4".  Interesting, I don't see why not, but it's working now. So I'm good for now.


@KGingeri wrote:

For instance I had tried TRIM("4/4") and it didn't as well as just "4/4".  Interesting, I don't see why not, but it's working now. So I'm good for now.


I think it could to do with the way AppSheet parser has been working. For a string of "4/4" it seems to be recognizing it as a date pattern. TRIM() will remove any empty spaces around but the string format of "4/4" still remains to recognize it as date.

With CONCATENATE() I believe parser thinks a text string is to follow and does not interpret or try to convert it as a date.  In a way by adding CONCATENATE(), it is explicit instruction to expect a text string to concatenate and not to attempt to interpret any other data type. Of course this is my understanding. Maybe I am incorrect. 

Top Labels in this Space