Got a bit of strange behaviour. I'm trying t...

Got a bit of strange behaviour.

I’m trying to get it so that

Any(Select(Users[Type],[Users]=UserEmail()))=”Employee”

can only add items to a sub-table, whereas

Any(Select(Users[Type],[Users]=UserEmail()))=”Management”

can add, edit and delete to the same table.

So to do this I have one table with 2 List Views, which both Ref the subtable.

The first points to the entire table, the second points to a slice.

This works fine.

I then thought I could use a

Show_If in the List/Ref of the main table to control which sub-table view you get to see.

The issue is that Appsheet seems to be totally ignoring the Show_If.

Whatever is in the Show_If, it always displays both.

I’ve even tried TRUE and FALSE.

Yet if I tick to hide them, it always hides them.

I’ve used this same technique before without issue.

Can anyone help or suggest a better way?

0 4 332
  • UX
4 REPLIES 4

@Simon_Robinson why don’t you set an “access privileges” table in your app and then according to the privileges from this table, use a SWITCH statement in your table’s Are updates allowed? property expression right under the Table Name? You don’t need to set seperate views for each access level then. More prettier and more smarter way to accomplish. Like this:

SWITCH( USEREMAIL(),

"user1@mydomain.com", “UPDATES_ONLY”,

"user2@mydomain.com", “ALL_CHANGES”,

“READ_ONLY” )

The SWITCH expression have the syntax of:

SWITCH( {Your condition to be evaluated}, {Case1}, {Value If TRUE}, {Case2}, {Value If TRUE}, . . . {Default Value If all cases are FALSE} )

FYI:

Any(Select(Users[Type],[Users]=UserEmail()))

can be expressed slightly more compactly as:

lookup(useremail(), users, users, type)

@Levent_KULACOGLU’s suggestion is the correct course of action.

@Levent_KULACOGLU Thanks for your help.

Didn’t realise there was a formula you could set in there!

Top Labels in this Space