Hello - I’ve had some CRUD restrictions on a table that have been working for the past 4 months, and all of a sudden my users are unable to Add new records because the expression is yielding the incorrect value.
I have a table called Cases where Medical Directors have the ability to ADDS_ONLY records, and it’s using a Switch Lookup to the Users table to determine the role of the user that’s logged in. Here’s the expression that I’m using:
I double checked the Users table and there is only one record with that email address.
Secondly, I tried your recommendation of quoting all textual values and no success there, unfortunately. The expression has been working without any issues until today. I’m guessing this is a bug with the way that AppSheet is interpreting the results of the expression
The issue doesn’t appear to be due to a mismatch or duplicate record in the Users table as I’ve verified that there is no discrepancies in the Users table, and I’ve tried with multiple users with the Medical Director role and the issue seems to persist across the board.
Any suggestion on further debugging this?
I really appreciate all of your help on this, Steve!
Yes, it’s only the Medical Director role that’s being affected. The other role, Admin, behaves as expected. The data type of the Role column is Enum with base type of Text
Yes, it’s only the Medical Director role that’s being affected. The other role, Admin , behaves as expected. The data type of the Role column is Enum with base type of Text
In the Error message you showed above, it reflects an “ANY(SELECT())” instead of LOOKUP(). Is that something that AppSheet did on their end? Or did you have an ANY(SELECT()) originally?
This may sound weird but, I have read comments about ANY() (and LOOKUP() seems to be a macro using ANY()) that it changes the type of the value.
Have you tried with INDEX() and a Current User slice instead of the whole dataset and LOOKUP()?
[Current_User (Slice) - How to conform your app around WHO is using the app](https://community.appsheet.com/t/current-user-slice-how-to-conform-your-app-around-who-is-using-the-app/35639/8) Tips & Tricks ?
It’s been my experience that ANY() can sometimes remove the “meta data” of a column; I’m talking about the deep layered data that AppSheet keeps internally that we can’t see. Stuff like: Referenced table Key column Referenced key column type But also stuff we can actually set: EnumList base type Enum base type ref table In the past when I would use ANY(), sometimes this information would be lost and I would loose the reference nature of the data or the base type of what we’re working with…
Since you don’t want to change everything (although you did the hardest part already) you could try this: