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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Reference column in Sh...
Power Apps
Answered

Reference column in SharePoint list based on name in the same list in a label

(0) ShareShare
ReportReport
Posted on by 24

I have a sharepoint list that displays two items: Name and number of points associated with a name. In my app, I have the list shown on the bottom half, and I would like to show the name of the person using the app and the number of points associated with that person.


The list looks like the following:

_____________________

Name         Points

Person1      23

Person2      12

Person3      32

Person4      34

_____________________

 

Say, Person1 is using the app, I would like the screen to display the following:

_____________________

Person1 - 23 Points

_____________________

 

 

How would one go about doing something like this? Thanks in advance!

 

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at

    @qhenry 

    You can find the current user's name with this code

     

    User().FullName

     

    And you can also LookUp their points in a Sharepoint List (assuming their name in SP is exactly the same).

     

    LookUp(your_datasource_name,Name=User().FullName,Points)

     

    So what you can do is take those functions and combine them in the Text property of a label

     

    Concatenate(
    	User().FullName,
    	" ",
    	Text(LookUp(your_datasource_name,Name=User().FullName,Points),"0"),
    	" Points"
    )

     

    The result will be:

     

    Person1 - 23 Points

     

    Keep in mind a person's name is not necessarily unique (e.g. there could be two people with the name John Smith).  For that I reason I would suggest using email instead.  You get a user's email by:

     

    User().Email

     

    ---
    Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    Add a label to the screen and set its Text property to a Lookup() of the list datasource where the DisplayName in the User column matches the User().fullname.  Or you could also use the Email address like this since display names sometimes get changed

    LookUp('Expense Reports','Created By'.Email=User().Email)
  • Verified answer
    RezaDorrani Profile Picture
    12,143 on at

    Hi @qhenry 

     

    First on AppStart -

     

    Set(varUserEmail, User().Email)  - this will create a variable which you can use throughout the app and avoid delegation warnings when comparing for current user (delegation enables you to work with large data sets) (https://www.youtube.com/watch?v=tPxE_-DcWkg)

     

    To show the user name 

    Create label and set Text property to - User().FullName

     

    and to get the points

    Create label and set Text property to - 

    LookUp(datasource,'Name'.Email=varUserEmail).Points

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard