web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Reference an Email of ...
Power Apps
Answered

Reference an Email of person/group type data from SP list in a Search function

(0) ShareShare
ReportReport
Posted on by 187

Hello, I can't really make out how to reference an Email of a person/group type in my SP list and use it in a Search function.

 

I have a gallery that searches for the Holiday Hours of the user with respect to Email and its Title but it always returns an error. I have a separate app with the exact same code but the only difference is that its SP list column for Email is of a single line of text type and it works fine. I've used Emails.Email, User().Email = Emails.Emails, "Emails".Email nothing works.

If(IsBlank(Sum(Search(leaveDetailsGallery.AllItems, ThisItem.Title, "Emails"),HolidayHours )),0,Sum(Search(leaveDetailsGallery.AllItems,ThisItem.Title,"Emails"),HolidayHours))

 

Revlock97_0-1653539184224.png

Pardon the delegation warnings. I'll work on that now.

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @Revlock97 ,

    Try this

    With(
     {
     wHours:
     Sum(
     Filter(
     leaveDetailsGallery.AllItems,
     Emails = ThisItem.Title
     ),
     HolidayHours
     )
     },
     If(
     wHours > 0,
     wHours,
     0
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Revlock97 Profile Picture
    187 on at

    @WarrenBelz 

    It worked like a charm! Thank you so much 🙂

     

     

  • Revlock97 Profile Picture
    187 on at

    @WarrenBelz Sorry but I don't suppose you could help me in referencing it using the Search function and the input.Text of a search bar?

     

     

     

    With(
     {
     StartDate: Date(2021,9,1) + 1,
     StartDateNow: Date(Year(Today()),Month(Today()),Day(Today()))
     
     },
     Sort(Search(Filter(
     colTeamCalendar2,'Start Time' >= StartDate Or 'Start Time' <= StartDateNow),txtSearcHistory.Text,"Title","Emails"),'Start Time',Descending
     )
    )

     

     

    This is the code that worked when the Emails was still a single line of text type. But I still don't know how to incorporate it now that it is of a Group/Person type. I tried using the With function like in the Filter code you gave me but it doesn't work for Search.Text references.

  • Verified answer
    WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @Revlock97 ,

    Yes, that column type is problematic with Power Apps (I do not use them) and you need to be aware of the limitations at times. Try this

    With(
     {
     StartDate: Date(2021,9,2),
     StartDateNow: Today()
     },
     Sort(
     Search(
     AddColumns(
     Filter(
     colTeamCalendar2,
     'Start Time' >= StartDate Or 'Start Time' <= StartDateNow
     ),
     "EmailAddress",
     Emails.Email
     ),
     txtSearcHistory.Text,
     "Title",
     "EmailAddress"
     ),
     'Start Time',
     Descending
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard