Filtering slices bases on another authenticated slice values

Hi All, i am trying to

filter one dataset(slice A)

based on …

another 1 Row line slice (Slice B) that only shows a row for the authenticated user (useremail().

Criteria
The filter should be based on the values in the slice B that matches the same columns in slice A

Both slices are from the same data source

any thoughts?

Welcome to the AppSheet community @Magnor_Maxi !

If your Slice B filter expression is say [Email]=USEREMAIL() returning single row per user.

Then your slice A filter expression could be something like

AND ( IN [Status A], Slice B [Status B]) , IN[ Customer A], Slice B [Customer B]) )

This is just an indicative expression. Actual will depend on your requirements, [Customer A] and [[Status A] are columns in Table A on which Slice A is based. [Customer B] and [[Status B] are columns in user details Table B on which Slice B is based.

As an important relevant reading on this user-based filtering, please go through the articles below just in case you have not. There are two different filters -Security and Slice that one will use based on app security requirements.

2 Likes

Thank you for the warm welcome & the response, will give it a shot!

Will this also suffice for multiple values across different columns in slice B?

Ex.Filter condition that requires a match in 3 columns?

1 Like

Yes it should, with a proper combination of AND() , OR() etc,

The below sample app may be handy. It has similar concept with one difference- it is not multiple user based. So there is no Slice B or Table B of user details. But in general it could give you idea on approach.

https://www.appsheet.com/samples/Allow-the-user-to-filter-a-view-based-on-a-form?appGuidString=91266cff-e843-46b8-a42b-3d85afedb37f

2 Likes

Perhaps i am running into some type of syntax error? Or is email the wrong column to use for

I believe there needs to be a parentheses " ( " after your two IN statements, it should be IN ( [Email] rather than IN [Email]

1 Like

Thank you! it works well! Is there a way to exclude the row with the authenticated email? That line appears in the UX view as well.

Also are you accessible for direct consulting services by the hour?