Filter out a table depending on useremail and enumlist

Aurelien
Google Developer Expert
Google Developer Expert

Hi AppSheet Team,

I’m currently building a slice depending on user allowances.
The purpose is to display a list of buttons to the users, so that they can jump to view according to what they are supposed to use.
Despite testing my expression outputs that looks OK, the result is not what I expect.
I describe the structure below.

Table : Menu View
List of possible views and deeplink expressions
3X_a_0_a0c9eab6921de48c1b8f42882fb1188452c581a2.png

Table : Users
List of users, with column [AccessLevel] set this way:

  • Type: EnumList,
  • Base Type: Ref,
  • Referenced table name: MenuView
    3X_b_d_bdd8895a705640d37830366fcff4c9a7bc44c078.png

Slice: MenuView_ReadOnly_PerUser_Slice
This slice filters the views allowed to the current user, depending on its email.

  • Source Table: Menu View
  • Row filter condition:
ISNOTBLANK(
  INTERSECT(    
    SPLIT(
      LOOKUP(
        USEREMAIL(),
        "Users",
        "UserEmail",
        "AccessLevel"
      )," , "
    ),
    LIST([key])
  )
)

What I expect:
a slice keeping the items that are allowed to the user.

What I see at evaluating data from my Table Users:
This is a result of the enumList I ticked
3X_f_1_f1f4da55af625c0f8efd268e6fb8040d0209d057.png

What I see at evaluating data from my slice:
This is the expected result (see below)

What I see at emulating in the editor:
Only one item, this is not what I expect to be displayed.
3X_8_6_86c4efc911fd75df19f897291c208746283038a1.png

I checked multiple times, the displayed view is based on the correct slice.
3X_9_a_9a03349892f7da11c27f551cb4157b1e8123ec60.png

I just can’t understand what’s going on.

Does someone have a clue ?
Many thanks in advance !

Solved Solved
0 16 420
1 ACCEPTED SOLUTION

Try:

IN(
  [key],
  SPLIT(("" & Users_currentUser_AccessLevel_ReadOnly_Slice[AccessLevel]), " , ")
)

View solution in original post

16 REPLIES 16
Top Labels in this Space