New Bug Encountered: Value 'XXXX' in field 'Enum' cannot be converted to type 'Enum'

There is a Problem with an Enum column giving me the Error Message:
Value ‘XXXX’ in field ‘Enum’ cannot be converted to type ‘Enum’.
I already send it to AppSheet Support.

The expression is:

LIST(
" 01 "," 02 "," 03 "," 04 ",
" 05 "," 06 "," 07 "," 08 ",
" 09 "," 10 "," 11 "," 12 ",
" 13 "," 14 "," 15 "," 16 ",
" 17 "," 18 "," 19 "," 20 ",
" 21 "," 22 "," 23 "," 24 ",
" 25 "," 26 "," 27 "," 28 ",
" 29 "," 30 "," 31 "," 32 ",
" 33 "," 34 "," 35 "," 36 ",
" 37 "," 38 "," 39 "," 40 "
)
Solved Solved
0 12 41K
1 ACCEPTED SOLUTION

Solution
I have to add the values manually in the Enum column.
I can use also an expression in suggested values to choose which values to show.

So even if I add manually the numbers from " 01 " up to " 40 "
2X_3_308980f26b92b0f92801cd41bc4be79883a8aa83.png
I can use the Expression in Suggested values to limit the amount of values. (In this example I limit it to 8 values)

TOP(
LIST(
" 01 "," 02 "," 03 "," 04 ",
" 05 "," 06 "," 07 "," 08 ",
" 09 "," 10 "," 11 "," 12 ",
" 13 "," 14 "," 15 "," 16 ",
" 17 "," 18 "," 19 "," 20 ",
" 21 "," 22 "," 23 "," 24 ",
" 25 "," 26 "," 27 "," 28 ",
" 29 "," 30 "," 31 "," 32 ",
" 33 "," 34 "," 35 "," 36 ",
" 37 "," 38 "," 39 "," 40 "
),
8
)

And this is how it looks like in the Form:

2X_d_d7383d659865470b4c3491ec71c24cfd73327107.png

View solution in original post

12 REPLIES 12

Steve
Platinum 4
Platinum 4

Perhaps set Allow other values to ON?

@Steve this would change the Buttons to a Dropdown field. That’s why I didn’t use it.
But I thought to give it a try. The result is confusing: In my Test App this is solving the problem. I still have Buttons and can save the Enum Value to my Sheet.
But in my real App it is changing the Buttons to a Dropdown.
The columns are exactly the same.
Do you have any idea how to force Buttons even with Allow other values enabled?

I wonder if the discrepancy has something to do with the age of your apps? Perhaps the behavior changed at some point but not back-ported to existing apps?

If this is the reason - what can I do?

I copied the App but it didn’t change.

I’m out of ideas, then. Next stop for you: support@appsheet.com.

Solution
I have to add the values manually in the Enum column.
I can use also an expression in suggested values to choose which values to show.

So even if I add manually the numbers from " 01 " up to " 40 "
2X_3_308980f26b92b0f92801cd41bc4be79883a8aa83.png
I can use the Expression in Suggested values to limit the amount of values. (In this example I limit it to 8 values)

TOP(
LIST(
" 01 "," 02 "," 03 "," 04 ",
" 05 "," 06 "," 07 "," 08 ",
" 09 "," 10 "," 11 "," 12 ",
" 13 "," 14 "," 15 "," 16 ",
" 17 "," 18 "," 19 "," 20 ",
" 21 "," 22 "," 23 "," 24 ",
" 25 "," 26 "," 27 "," 28 ",
" 29 "," 30 "," 31 "," 32 ",
" 33 "," 34 "," 35 "," 36 ",
" 37 "," 38 "," 39 "," 40 "
),
8
)

And this is how it looks like in the Form:

2X_d_d7383d659865470b4c3491ec71c24cfd73327107.png

This is useful to me. I was just in the process of trying to do something similar and got the same error. In my case, I have a “settings” table where users can choose among different options. Accordingly, each row should have a different set of options. I assume that your solution, @Fabian, is the best one given how the AppSheet is currently configured but it would be nice if the suggested values did not have to be entered in by hand.

By the way, is there any way to know whether the date of a post is this year or a previous year? Now that the archive is over a year old, it’s hard to tell in cases like this.

Ah! I see that, now that I have posted a reply, my reply is 2 months later. So, now I know that this thread is from this year. But there ought to be a better way to figure out what year something was posted.

Finally figured it out. If the post is from a different year, the year will be shown. Still, it would be nice if the current year would be shown when some clicks on the date of a post.

I know this problem has been solved but I took an interest in it for my own reasons. I think I found a simpler solution:

In short: Just do everything in the “Valid if” spot.

When I tried to show how my approach could be used to solve your problem, @Fabian, I encountered a different issue:

3X_0_8_0836cad4f195a68cbf6ad10a1a3f37b2bd99bbfe.png

Even though the list is identified as “text”, the phenomenon seems to have something to do with AppSheet interpreting the numbers surrounded by spaces as numbers. When I changed the view to tablet the problem went away. Also, when I used text words for my list, I didn’t have the problem to begin with.

@Kirk_Masden Thanks for investigating. This seems to be very fragile. I tried to put the expression from Suggested_Values to Valid_If. But then I was not able to select from the Enum. I mean, I can click on a value, but the button won’t change it’s color. And by saving, no value would be saved.
I then entered the expression back into Suggested_Values (as it was before) and it didn’t work either.
So I restored the App Version to get it work again.
So thank you for contacting AppSheet about this, Kirk.

Thanks @Fabian! I’m not sure what caused your problem. My column is a normal column (not virtual) and I’m able to save the values whether they are in “Suggested_Values” or “Valid_If.”

I haven’t done it yet but I’ll put this in a message to AppSheet support.

Top Labels in this Space