Trying to restrict user access at company level.
I have created a SharePoint List as below:
One user can handle multiple companies as well.
| Company | Email ID |
| ABC | def@xyz.com |
| DEF | def@xyz.com |
| JKL | qrs@hij.com |
| YTU | iop@edf.com |
I have a gallery control to display details. How can I filter this gallery control to show details only for the companies the logged in user belongs to?
This is what I have done -
If(LookUp(DataSource,Title=User().Email,Companies) <> Blank(),ClearCollect(CompanyAccess, ShowColumns(Gallery9.AllItems,"Companies")),Notify("Please contact Admin for access"));
This is storing all the companies which the logged in user belongs to.
The gallery control is not filtering. This is what I have done on Gallery Control Items Property -
Filter(IAForm, StartsWith(Ref_ID,TextInput1_2.Text) ,Company.Value in ForAll(CompanyAccess,Company))
If the collection contains a single value it filters using below:
Filter(IAForm, StartsWith(Ref_ID,TextInput1_2.Text) ,Company.Value in CompanyAccess))
But if it contains multiple values it does not (one user can belong to multiple companies) which is what I am looking for.
Please advise.
@RandyHayes @WarrenBelz