cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
qhenry
Level: Powered On

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

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!

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
mdevaney
Level 8

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

@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."

View solution in original post

Dual Super User
Dual Super User

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

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

 

 

View solution in original post

3 REPLIES 3
mdevaney
Level 8

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

@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."

View solution in original post

Dual Super User
Dual Super User

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

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)


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

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

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

 

 

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 206 members 5,482 guests
Please welcome our newest community members: