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 345
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