cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Suresh1409
Frequent Visitor

Email Address Verification using a list

Hi, 

 

I am trying to make a button visible only if the User().Email is matching with atleast one of the email addresses in my Sharepoint List Column called EAddress.

 

Please help me on this. Thanks 

9 REPLIES 9
Jeff_Thorpe
Super User
Super User

Try adding this to the visible property of the button.

 

!IsEmpty(Lookup('SPList', User().Email = EAddress))

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Hi Jeff, 

 

Thank you for the immediate response. Please find the attached

 

 

 

 

@Suresh1409 

Add a .Email to your formula.  

!IsEmpty(Lookup('SJA Coating Adviser Responsible', User().Email = EAddress.Email))

 

This is assuming you have created your column EAddress as a Person column.  If that is not the case, then reply back.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Hi Randy, 

 

It worked out but I have given a different logic as below.

MailAdd - Single Text containing email address

usermailvar - variable set for user().email

 

!IsEmpty(LookUp('SJA Coating Adviser Responsible', MailAdd=usermailvar))

 

It shows up for my id now but i need to test with other users. when i try to remove my email from the list, the visibility is still ON. Not sure whether its a powerapps slowness to capture the update from sharepoint.

Inorder for PowerApps to refelxt your latest update from SharePoint, you would have to Refresh your data source using the Refresh function or just re start the App which reloads all your collections

Hi Reza, 

 

I have tried that but in vain 

 

Regards

Suresh

@Suresh1409 

I'm not sure what you mean by you need to test with other users.

Even if you change the email address in your SharePoint list, that is not going to impact your App because it is still verifying against your email address.  

If you want to test with other users, then you need to change your usermailvar to be the email addres of the other user...not your SharePoint list, as that condition will never happen.


Now, with that in mind - you might also want to change your formula to the following:

   !IsBlank(Lookup('SJA Coating Adviser Responsible', MailAdd=usermailvar).ID)

IsEmpty will always return false, even if it doesn't exist.  With IsBlank, you are (in this formula) checking a specific column (ID) for blank.  If it's not found, then it will be blank and your formula will work.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Hi Randy, 

 

The below code worked. However, when i add one more email address with a separator as semicolon in the list column, it seems there is a problem in looking up. Let me try again.

 

!IsBlank(LookUp('SJA Coating Adviser Responsible',MailAdd=usermailvar).MailAdd)

@Suresh1409 

Yes, it's not going to do anything with that semicolon except be part of the original text field.  Your formula will not work on that scenario.

In this case your logic will need to change.  Originally it was thought that you had a list of items with an email address in it that would determine (if the email was in the list) that the button should be visible.

But, now you are indicating that the list may have multiple emails in each record.

So, the question would be, what is the record that has the information to determine this?

 

Are you trying to make the button visible on a record item (i.e. in a gallery) or is the button particular to the app in general.  

In other words - if you are dealing with the button on a record by record basis, then your logic for determining the email address would be based on the EAddress field of the record.

If you are dealing with many records and you are trying to determine if a person is in the EAdress field...the question is - of what record?

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (48,697)