Hi. I found another post that was similar to what I want, but not exactly on target.
I want to set a variable based on 2 conditions. I have a list of Admins that I lookup so I can evaluate the logged in user to see if they are on the Admin list. If so, then certain fields are visible to them. This is the expression for that and it runs on the OnVisible setting of my form:
(Set(varUserAdmin,LookUp(colAdmin,'Admin Name'.Email=varCurrentUserEmail)))
Now I want to add a condition. I have added a Status column to my Admin list and the status is either Active or Inactive. I want to look up the admin on the list and only evaluate the admins with a Status of Active. What would that expression look like?
Solved! Go to Solution.
You could set your variable to
Set(varUser,IsBlank(
LookUp(
colAdmin,'Admin Name'.Email=varCurrentUserEmail &&
Status="Active"
)
)
)
This will reduce to either true or false and you can use the variable as the Visible property of the controls in question.
You could set your variable to
Set(varUser,IsBlank(
LookUp(
colAdmin,'Admin Name'.Email=varCurrentUserEmail &&
Status="Active"
)
)
)
This will reduce to either true or false and you can use the variable as the Visible property of the controls in question.
I initially got an error because my Status field is a choice column. I just switched it to Text (easy enough to manage, it's basically a static list) and the error went away. Thank you!!
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
184 | |
53 | |
50 | |
36 | |
35 |
User | Count |
---|---|
270 | |
91 | |
82 | |
76 | |
75 |