cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
biancadevera
Helper III
Helper III

Match current user's email to a column in SharePoint list

I have created a list with the following columns:

  • Title: email address (Single text line)
  • Name: preferred name (Single text line)

I would like to match it with my User().Email. Is this possible?

 

Would like to filter my data based on the current user signed in (User().Email) with the data I have on my list. I've used the 'Created by'.Email = User().Email before but this will only work if it was created by a certain user.  

8 REPLIES 8
Pstork1
Dual Super User III
Dual Super User III

Use the following in the gallery items

Set(currentEmail, user().Email);
Filter(<<datasourcename>>, Title=currentEmail);


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
biancadevera
Helper III
Helper III

Hi @Pstork1 I had this error:

biancadevera_0-1637716001369.png

 

Pstork1
Dual Super User III
Dual Super User III

Put the Set() in the onVisible property for the screen.  



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Tried to add the code in my Screen's OnVisible property: 

 

Set(currentEmail, user().Email);

 

No errors but results are not showing.

Pstork1
Dual Super User III
Dual Super User III

Did you check to see that the currentEmail variable was set after a run and what the value was?



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
biancadevera
Helper III
Helper III

@Pstork1 how can I check that?

Pstork1
Dual Super User III
Dual Super User III

After running the app in the Preview function of the editor check what is in the variables list.

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
biancadevera
Helper III
Helper III

Hi @Pstork1  just an update about this. I found a workaround for this issue. I created another column in my SP list and list down the email addresses. Was able to achieve my goal. Thanks for the help.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,216)