Sucurity filter

Hi everyone
in a security filter I use this formula:

AND(CONTAINS(IFS( [UserSelect]=”Rampa 1” , LEFT([RAMPA],FIND("/",[RAMPA])-1), [UserSelect]=”Rampa 2” ,RIGHT([RAMPA],FIND("/",[RAMPA])+1), [UserSelect]=”Both” , [Rampa])
, LOOKUP(USEREMAIL(),RAMPE,EMAIL,UTENTI)), OR([status]=“open”, [status]=“closed”,[status]=""))

do you think is the right way? everything works but I think it’s a bit cumbersome.
in a “ramp” column I insert the employee’s surname, and in the userselect column I insert Rampa1.
you can switch the name entered in the “Ramp” column and then insert Ramp 2.
Can you think of another way?
thank you

0 4 346
4 REPLIES 4

EIG
New Member

Are there other values that status can contain besides “open”, “close” and “”? If not, then why even check it. Then you could drop the And() and the OR().

Just to make it easier to read:

AND(
CONTAINS(
IFS(
[UserSelect]=”Rampa 1” , LEFT([RAMPA],FIND("/",[RAMPA])-1),
[UserSelect]=”Rampa 2” ,RIGHT([RAMPA],FIND("/",[RAMPA])+1),
[UserSelect]=”Both” , [Rampa]
),
LOOKUP(USEREMAIL(),RAMPE,EMAIL,UTENTI)
),
OR(
[status]=“open”,
[status]=“closed”,
[status]=""
)
)

This is a beast of a security formula, I wouldn’t do something like that - especially if your app will have anything over 5,000 records.

It’s the CONTAINS() (and the Find) that I would try and replace.

It looks like you’ve got the ability for a user to select which data they’re looking at, and you’re gating based on if something from the user table is inside a portion of a column (left or right).

This [RAMPA] column, looks like it’s going to contain data like:

Something/Something_Else

and you’re trying to find if the user’s looked up data is inside this.

I would try to make the [RAMPA] column an enumlist, this way you can make use of the IN() function instead of contains - IN () is MUCH faster.


AND(
	CONTAINS(
		IFS(
			[UserSelect]=”Rampa 1” , LEFT([RAMPA],FIND("/",[RAMPA])-1),
			[UserSelect]=”Rampa 2” ,RIGHT([RAMPA],FIND("/",[RAMPA])+1),
			[UserSelect]=”Both” , [Rampa]
		),
		LOOKUP(USEREMAIL(),RAMPE,EMAIL,UTENTI)
	),
	OR(
		isblank([status]), 
		in([status], list("open", "closed"))
	)
)

thanks!!

hi
in the RAMP column I write the name of the FRENCH employee and insert ramp1.
Unfortunately sometimes I need to assign the same row to another employee by no longer displaying the row at ramp 1
then I insert FRENCH/LUCK and INSERT Ramp 2.
this assignment must be made by force from the google sheet.
but it is quite cumbersome.
How can I make the formula lighter?

Top Labels in this Space