cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

Filter Gallery items by current user shows no data

Hi all, 

 

I would like to filter the items in the gallery by the current user.  For that, I created a  variable OnStart

Set(
    VarUser,
    Office365Users.MyProfileV2()
);

 

then on the Gallery's item section, I added the following:

 

SortByColumns(Filter([@'Customer Engagement Request'], VarUser.displayName in 'Primary Resource Assigned'.DisplayName, StartsWith(Title, TextSearchBox1.Text)), "Created", Descending)

 

I get no errors using these functions but I also get no data on my Gallery.  

 

any idea what might be happening here?

nodataGallery.jpg

 

4 REPLIES 4
Highlighted
Super User III
Super User III

Hi @F_Quint ,

Try this at OnStart

 

Set(
    VarUser,
    User().FullName
)

 

then this for the filter

 

SortByColumns(
   Filter(
      [@'Customer Engagement Request'],
      'Primary Resource Assigned'.DisplayName = VarUser &&
      StartsWith(
         Title, 
         TextSearchBox1.Text
      )    
   ),
   "Created", 
   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.

Highlighted

Hi @WarrenBelz thank you for your help.  

I tried what you suggested by it get the following error.  

 

warrenadvice.jpg

Highlighted

@F_Quint ,

Dangers of free-typing on iPad. Bracket in wrong place. I will also fix on original post.

SortByColumns(
   Filter(
      [@'Customer Engagement Request'],
      'Primary Resource Assigned'.DisplayName = VarUser &&
      StartsWith(
         Title, 
         TextSearchBox1.Text
      )    
   ), 
   "Created", 
   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.

Highlighted
Helper I
Helper I

@F_Quint 

this formula should work: Filter(FirstFile, UserName= User().FullName) - to get data by UserName, 

where FirstFile is the File or Sharepoint list <data source> from which you want to get data and 

UserName is the column in which user names are being stored.

but because the formula doesn't retrieve any data,
please check if the data in the UserName column is in the same format as that of User().FullName.

 

Regards,

Repath Athyala.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,661)