So I have a collection called AdminList, which is collected on startup of App, and it has several columns in it. The column I want is labeled Mail. On a users screen I have a block that says Admin and I want it to return weather they are or not using there Office365Users Mail. Below is what I came up with but it doesn't work. My problem lies in the AdminList part, as I know the Office365Users portion works elsewhere.
If(AdminList.value(Mail) = Office365Users.UserProfile(InfoAbout.Text).Mail,"Yes","No")
Solved! Go to Solution.
I figured it out. I had to reference a textbox to get it to work correctly. The one that is referenced is pulling the original
Office365Users.UserProfile(InfoAbout.Text).Mail
string in. Here is what I did.
If(!IsBlank(LookUp(AdminList,mail=TextBox4_97.Text)),"Yes","No")
Hi @Wisper
To see if a user is a member of a list, capture the user's Email in a variable when the App opens. In the OnStart property of the app put Set(userEmail,User().Email). You can test this variable against a list membership as follows.
!IsBlank(Lookup(Adminlist,email=userEmail))
If this formula is put into a Label control, this will return a true or false value.
Thank you for the reply. I am not trying to evaluate the user using the app but on a customer screen. I am trying to see if a specific customer is an Admin.
@Drrickryp , I did try the following but I know he is not an admin and it evaluates as true for some reason.
If(!IsBlank(LookUp(AdminList,Mail=Office365Users.UserProfile(InfoAbout.Text).Mail))=true,"Yes","No")
Sometimes differences in case or spaces can cause the equation to be incorrect. Try
!IsBlank(LookUp(AdminList,Trim(Lower(Mail))=Trim(Lower(Office365Users.UserProfile(InfoAbout.Text).Mail))))
in a text box and see what the result is. You may need to look at the Office users table as well to see if the mail addresses match.
I figured it out. I had to reference a textbox to get it to work correctly. The one that is referenced is pulling the original
Office365Users.UserProfile(InfoAbout.Text).Mail
string in. Here is what I did.
If(!IsBlank(LookUp(AdminList,mail=TextBox4_97.Text)),"Yes","No")