I have an IFS statement:
IFS(LOOKUP(USEREMAIL(), Users, Usr_Email, Time_View) = โThis Pay Periodโ,
โTHISโ,
LOOKUP(USEREMAIL(), Users, Usr_Email, Time_View) = โLast Pay Periodโ,
โLASTโ
)
It checks the selection from an Enum value, โTime_Viewโ but it always returns the opposite value.
โThis Pay Periodโ returns โLASTโ
and โLast Pay Periodโ returns โTHISโโฆ
I have tried using a switch case instead and still had the same issueโฆ
Hi @Nate_T Did you test this in the expression tester?
I recommend testing the expression in pieces. Start with just the inner part that I quoted, and make sure it is working correctly, then add on to it.
I agree with both @Lynn and @Marc_Dillon: test the LOOKUP() expression in Expression Assistant. Your IFS() expression looks correct, but you could have problems if USEREMAIL() returns blank (e.g., if your app is open to the public) or if the LOOKUP() returns blank (e.g., if the userโs email isnโt in Users).
This expression might help troubleshoot:
IF(
ISBLANK(USEREMAIL()),
"no useremail",
SWITCH(
LOOKUP(
USEREMAIL(),
"Users",
"Usr_Email",
"Time_View"
),
"This Pay Period", "THIS",
"Last Pay Period", "LAST",
"no time_view"
)
)
Thanks for the suggestions everyone!
Steve, I tried your expression and it yields the exact same results.
Even the following expression results in the same issue:
CONCATENATE(USEREMAIL(), " ", LOOKUP(USEREMAIL(), Users, Usr_Email, Time_View))
The result consistently returns my email with the opposite string after it.
I also tried adding a virtual column with the exact same expression. Itโs result ends up being correct after a sync happens (Delayed sync is enabled). But if I quickly select back and forth between them before it has a chance to sync, both of the returned values update immediately and both are wrong.
Then, after the sync completes, the virtual column finally goes back to what it should beโฆ
*Forgot to mention - I am using a google spreadsheet to hold my data. The selection in Appsheet is properly reflected in the google spreadsheet.
Are either of the Usr_Email or Time_View columns of the Users table virtual columns? If so, what are the app formulas?
Do any of the corresponding worksheet cells have formulas?
Is Users a slice? If so what is the row filter expression?
Does the Users table have a security filter? If so, what is it?
Usr_Email is a static cell and is used as the key column in the Users table and does not have any formula.
Time_View is an Enum type with two selections, โThis pay periodโ and โLast Pay Periodโ with no formula.
Both Usr_Email and Time_View are columns in the Users table in the Google sheet.
Date_Display set as type โtextโ which holds the formulas that we have been discussing. Date_Display is also in the Google spreadsheet.
There are no formulas in the google sheet. All formulas are in Appsheet.
Users is not a slice and has no security filter. This app is for one company with less than 10 users that are added to the whitelist.
Iโm at a loss, then. I suggest you reach out directly to support@appsheet.com for deeper help than I can provide.
Ok thanks Steve!
I solved the issue by deleting the table from Appsheet and re-adding it.
I didnโt get a final response from Appsheet support but the cause of the issue seemed to be related to regenerating the tableโฆ
I must admit, I have also experienced problems that were solved that wayโฆ
User | Count |
---|---|
14 | |
11 | |
9 | |
7 | |
4 |