Security Filter with INTERSECT need HELP

Hello, really need some help.
I have a user table with a manually added list of โ€œresource idsโ€ that they will be allowed to update.
Then I have a table of Scope items with the โ€œlist of resource idsโ€ that will be used for that scope item.
I was trying to drop an INTERSECT in the security filter, and Iโ€™ve even tried count, and iโ€™m just not getting anywhereโ€ฆ Itโ€™s starting to feel buggy

    ISNOTBLANK(
	INTERSECT(
    LIST()+[_THISROW].[scope_metadata_list],
    LIST()+USERPERM_CURRENT[userperm_ANY_tags]
    )
    )

Also here is a video of my setup if you think it will help. @Steve I know youโ€™ve been hitting this particular area hard, and even alerted me of the bug. Do you have any input?

0 16 513
16 REPLIES 16

I would try CONTAINS () - it works better than IN, INTERSECT etc. in security filters.

Wait, I take that back; it wonโ€™t work since you have two lists.

@Grant_Stead I checked with ISNOTBLANK(INTERSECT(LIST()+[LIST],LIST()+Test2[NAME])) where the [LIST] is EnumList with the column type Text and the [NAME] is text type as well. And it works just fine. Please check your column types.

They are both marked enumlist with a ", " separator.

Here is the USERPERM_CURRENT Slice data:

With NO security filter here is the โ€œlist of resourcesโ€ in scopeโ€ฆ

I will check your test appโ€ฆ

Steve
Platinum 4
Platinum 4

Try:

ISNOTBLANK(
  INTERSECT(
    LIST() + [_THISROW].[scope_metadata_list],
    LIST() + SPLIT(USERPERM_CURRENT[userperm_ANY_tags], " , ")
  )
)

What I still donโ€™t understand is why I canโ€™t go ANY(enumlist_column)

ISNOTBLANK(
  INTERSECT(
    LIST() + [scope_metadata_list],
    LIST() + ANY(USERPERM_CURRENT[userperm_ANY_tags])
  )
)

As far as I can determine, ANY() wants to return one value, period, so it forces a List or EnumList to Text. I wonโ€™t pretend to justify it.

Holy Heckโ€ฆ ^^THAT^^ is the single biggest misunderstanding of my entire appsheet list career!
Like, Iโ€™m blown away

Yeah, took me awhile to digest it when I discovered itโ€ฆ

I tried wrapping my ANY in a LIST() it didnโ€™t workโ€ฆ

Youโ€™ll need to use SPLIT(), not LIST():

SPLIT(ANY(USERPERM_CURRENT[userperm_ANY_tags]), " , ")

If USERPERM_CURRENT will only ever have one row, you donโ€™t need ANY():

SPLIT(USERPERM_CURRENT[userperm_ANY_tags], " , ")

I think itโ€™s starting to sink inโ€ฆ LoL. At least itโ€™s working now. How long have we been talking about lists together, 2 years now?

Yepโ€ฆ

Update,
@Steve and @Aleksi you both came to the same conclusionโ€ฆ That I donโ€™t understand lists yetโ€ฆ BAHAhAhAA when I included the [_THSIROW] I did NOT get any results. (I think maybe cause itโ€™s a security filter??)

I also needed to change my USERPERM tags to " , " vs ", "

Still looking into another issue, but thank you both for helping me get this handled.

Top Labels in this Space