Hi,
Having some trouble achieving something at the moment; I've found a few very similar threads but nothing seems to work my side/hit exactly what I'm after.
I want to check, on load, whether the current user is a member of a list and depending on that result assign them a role.
I have a list called 'Admin' which is a simple one-column list containing a ~10 users; the datatype is Person/Group.
Currently I have the below in the OnStart section of my Form.
Set(currentUser, User())
A previous iteration also included UpdateContext({currentUser: User()}) but I can't see what, if any impact that is having on the logic.
I then have a Label with the text value of:
If(LookUp(Admin, currentUser.Email in User.Email),"Y","N")
I have also tried currentUser in User etc and also exposed the values in a gallery... If I apply the logic to the gallery it filters to show me the correct result but this doesn't help me in setting the value of a variable.
At this stage I just want to prove yes or no, is this user in this list but it returns blank regardless. Am I missing something very obvious here?
The next step would be to check that if the person is in the list assign them role X, if they're not, role Y.