Help with Logic

Hi community

I need some help with expression logic.

I have an enum column with 3 options. Sunny, Hat, and Wonder.

I have an initial value expression

IFS(USEREMAIL()=sunnytab@gmail.com,"Sunny",USEREMAIL()=hattab@gmail.com,"Hat",USEREMAIL()=wondertab@gmail.com,"Wonder")

This allows the users at these three locations to not have to select their location.

However, I have an area manager who wants to be able to capture data on behalf of any one of the stores but I'm lost on how to give him access to be able to choose any option as it does not show the question in the form with the above expression.

Can someone help me with advice, please?

0 4 103
4 REPLIES 4

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Jared12345 

You may want to use a SWITCH() expression in your enumList column.

And use that expression in the Data Validation/Valid_If expression.

What about this:

SWITCH(USEREMAIL(),
  sunnytab@gmail.com,LIST("Sunny"),
  hattab@gmail.com,LIST("Hat"),
  wondertab@gmail.com,LIST("Wonder"),
  LIST("Sunny" , "Hat" , "Wonder")
)

 

For reference:

https://help.appsheet.com/en/articles/2355972-switch

 

Thank you for your response. 

I tried this expression firstly in the initial value cause I didn't read the entire message.

The I moved my expression to the Valid IF and the Switch above to the App formula but it didn't work.

Although both expressions get the green light, the Valid_if breaks the app.

What am I doing wrong?

 


@Jared12345 wrote:

Although both expressions get the green light, the Valid_if breaks the app.


In what way does it break the app? Is there an error message? Perhaps you could post a screenshot demonstrating the breakage?

Aurelien
Google Developer Expert
Google Developer Expert

ok. 

Just to make sure, can you:

- remove any value suggestion

- tick the "allow other values"

Something like that:

Aurelien_0-1649951571966.png

 

Top Labels in this Space