How would one go about creating an Enum or En...

(Greg Huston) #1

How would one go about creating an Enum or Enumlist, where one of the values is only selectable once.

In my app, I’m trying to allow a customer to have multiple addresses. So far so good. The user can use an Enum/Enumlist to assign those addresses the values…

  • Billing (can have multiple) - Main (can only have one!) - Shipping (can have multiple)

So a company can have multiple shipping addresses, but only ONE main address. So if a person tries to select “MAIN” for a company that already has a main address, I would like it to ideally remove the main value from the other address and assign it to the new one.

Is this possible? Or should I simply have a valid_if check telling them to go remove the other main address first?

Thanks!

(Aleksi Alkio) #2

Check the section “Preventing Duplicate Field Values” from this article… help.appsheet.com - List Expressions and Aggregates List Expressions and Aggregates help.appsheet.com

(Tony Fader) #3

@Greg_Huston This app might also be helpful for you: https://www.appsheet.com/samples/Only-allow-values-that-havent-been-chosen-in-dropdown?appGuidString=0fff1325-90cd-4259-814f-91bafe271f55