cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JimmyWork
Power Participant
Power Participant

Filter gallery based on displayName from a SharePoint person column

Hi

 

In my SharePoint list i have a person column named "Assigned To"

What i would like to do is filter a gallery to only show items that I'm assigned to.

 

I created a variable.
Set(varDisplayName, User().FullName);

Now i did not use User().Email because email will display wrong due to some users email is not all lower characters.

My question is will User().FullName match the data from the "Assigned To" column: 'Assigned To'.DisplayName or will it be like it is with .Email?

 

How else can i solve this?

I did a solution for the Created by where i write the created by email to another column with all lower cases but i cannot do this with the Assig

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @JimmyWork ,

Do you want to compare User().FullName with a person column value in sharepoint list?

Does your person field allow multiple person choice?

You just need to use formula like this:

Filter(table,User().FullName='Assigned To'.DisplayName)

I know you are worried about the letter case of  User().FullName and DisplayName in person field.

Don't worry, these two's value are the same.

Although these two value comes from different places, one from powerapps, one from sharepoint.

But actually their data source is the same.

These two names  all come from your Office365 profile.

 

If you are still worried about this, you could check the DisplayName of 'Assigned To' in your app directly.

For example:

Insert a combo box, set the combo box's Items:

Choices(listname.'Assigned To')

Set the combo box's primary text to DisplayName. 

Then you could search yourself in the combo box, the combo box will display your DisplayName.

Insert another label, set its Text to :User().FullName .

Then compare the value displaying in the combo box and the label. I believe they are the same.

 

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
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

8 REPLIES 8
WarrenBelz
Super User III
Super User III

Hi @JimmyWork ,

As long as Assigned To containers the exact spelling of User().FullName, a filter will work.

You can also use Lower() on both to get rid of any case sensitive issues.

 

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.

@WarrenBelz I can't use Lower because i cannot delegate using Lower and im wondering how User().Fullname compares to the data from the person field using displayName, i do know that .Email will not be the same from a person column and the User().Email so im wondering if maybe displayName will always match? What is displayName actually pulling from compared to the User().Fullname?

Hi @JimmyWork ,

Yes - Lower is not delegable unless you can collect the data and and then use Lower on varDisplayName.

The comparison to the Person field depends on where you are getting this from.

@WarrenBelz Thank you for answering

 

If i would do Lower on varDisplayName then it will not work as i cannot do Lower on the AssignedTo.DisplayName

Im getting the AsiignedTo.Displayname from a SharePoint column

Powerapps is then using the User().Fullname and i do not know where the 2 different locations pull the data from.

 

Im not sure if i can create a variable that is Lower(AssignedTo.Email) but im pretty sure i can't

Hi @JimmyWork ,

Do you want to compare User().FullName with a person column value in sharepoint list?

Does your person field allow multiple person choice?

You just need to use formula like this:

Filter(table,User().FullName='Assigned To'.DisplayName)

I know you are worried about the letter case of  User().FullName and DisplayName in person field.

Don't worry, these two's value are the same.

Although these two value comes from different places, one from powerapps, one from sharepoint.

But actually their data source is the same.

These two names  all come from your Office365 profile.

 

If you are still worried about this, you could check the DisplayName of 'Assigned To' in your app directly.

For example:

Insert a combo box, set the combo box's Items:

Choices(listname.'Assigned To')

Set the combo box's primary text to DisplayName. 

Then you could search yourself in the combo box, the combo box will display your DisplayName.

Insert another label, set its Text to :User().FullName .

Then compare the value displaying in the combo box and the label. I believe they are the same.

 

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
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

Hi @JimmyWork ,

Timezone issues have prevented me responding until now.

I will leave you with @v-yutliu-msft here unless you want further input from me (tag me if so).

Hi Phoebe

I have the same need, and I can't see why this code doesn't work - MinisterialAuthor is a vanilla person column from a modern sharepoint list, Ministerials.

Filter([@Ministerials], MinisterialAuthor.DisplayName = User().FullName )
 
 
Error is "Invalid Argument type", and the formula is in the items property of a gallery.
 

 

 

Hi @v-yutliu-msft! I have the same requirement but mine would be based on email address. I am creating an app where I am using the gallery items to populate the form based on an SP list. These gallery items are based on the country keyed-in in the text input and can be processed by 1 or more persons depending on the email address(es) indicated in a column in the SP list called "System Owner Email Add". However, the current formula that I am using can only accept 1 email address. If the cell in the in the column "System Owner Email Add" contains multiple emails address, the gallery items will only be visible to the first email address in the cell.

 

My goal is for the galley items to be visible to all the users indicated in the "System Owner Email Add" column and any of them will be able to process the task.

 

Below is the simplified SP List.

 
Server NameCountrySystem Owner Email AddAction Taken
Server ACountry Aabc@abc.com
def@abc.com
ghi@abc.com
This will be based on whichever action is selected in the app by the System Owner.
Server BCountry Bjkl@abc.com
mno@abc.com
This will be based on whichever action is selected in the app by the System Owner.

 

Appreciate your advice.

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

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (40,018)