Hi, In multi-users/one-datafile (each user wi...

(Alper) #1

Hi, In multi-users/one-datafile (each user with different login) scenario, how can I create an usersettings enum listing which is customized for each one of users? (ie, each user may have several properties/facilities, enum-selected prior to data entry, for security filter). Currently my app is designed for single user and I am using multiple tables for the user, but all these tables are in a single Google sheet file (workbook). Was planning to use one workbook per user but seem not possible without bussiness plan. Can you confirm that usersettings() enum selection option is fixed, per app, for multiple users? (List of enum items cannot be different for each username() ) And if this is the case, If I have to use only one Google sheet file for data of all users, how can I solve custom usersettings_enum per unique user problem?

(Dinh Nguyen Nguyen) #2

@Alper You can use a Valid_If in your user settings column to create a dynamic drop-down. Depending on the user’s email address, the Valid_If expression will create a different list of options. Here’s an example using the SWITCH() expression:

SWITCH(USEREMAIL(), "user1@appsheet.com", LIST(“user1option1”, “user1option2”), "user2@appsheet.com", LIST(“user2option1”, “user2option2”), …)

More information about the SWITCH expression can be found here:

help.appsheet.com - SWITCH() SWITCH() help.appsheet.com

(Steven Coile) #3

Maintain a separate table with email (Email) and tags (EnumList) columns, then the user setting Valid_If can be =LOOKUP(USEREMAIL(), “MyTable”, “email”, “tags”).

Or maintain a separate table with email (Email) and tag (Enum) columns, then the user setting Valid_If can be =SELECT(MyTable[tag], ([email] = USEREMAIL()))

(Alper) #4

@Harry +Steve Coile Thank you very much to both of you, I will inspect both solutions to choose best fit. Meanwhile, I was thinking for another way to make it, wanted to share. Normally I am using a separate table with a single row to read settings of the user. Since it was always single row, I was reading it directly or with index(sheet[column] , 1). If I add more lines by manually entering the settings one-row per user, and than apply security filter to keep it one line all the time, that seem also work.

(Steven Coile) #5

If the table is guaranteed to be only a single row, ANY() is shorter than INDEX(). :slight_smile:

(Alper) #6

Great! :slight_smile: