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 / Filter gallery based o...
Power Apps
Unanswered

Filter gallery based on Created By

(0) ShareShare
ReportReport
Posted on by 1,168

Hi,

 

I am trying to filter a gallery with Sharepoint Source based on the Created By Column.

 

I want to have a combo box that displays a shortened version of the Display name but search by full display name.

 

Combobox is taken care of by the following in the Items section

 

Sort(Distinct(SharepointList,Left('Created By'.DisplayName,Find(" ",'Created By'.DisplayName)-1)),SortOrder.Ascending)

 

Im struggling to nail the filter function & would appreciate any assistance.

 

My attempt has been

 

Filter(Collection3,'Created By'.DisplayName = Combobox1_1.SelectedItems)

 

Thanks in advance

 

Todd

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Tango ,

     

    the formula you have written on combobox is correct

    Sort(Distinct(SharepointList,Left('Created By'.DisplayName,Find(" ",'Created By'.DisplayName)-1)),SortOrder.Ascending)

     

    I used this formula and it works the same

    Distinct(News.'Created By','Created By'.DisplayName)

     

    Filter formula ->

    Filter(YourListName,'Created By'.DisplayName = ComboBox1.Selected.Value)

     

    Let me know if this helps. 

    Thanks 😀

  • WarrenBelz Profile Picture
    156,327 Most Valuable Professional on at

    Hi @Tango ,

    The issue is that you have removed the full field from the Combo Box Items, so it is no longer there to filter on. Try in the Items

     

     

    Sort(
     GroupBy(
     AddColumns(
     SharePointList,
     "FirstName",
     First(
     Split(
     'Created By'.DisplayName,
     " "
     )
     ).Value,
     "FullName",
     'Created By'.DisplayName
     ),
     "FullName",
     "FirstName",
     "Data"
     ),
     FirstName
    ).FullName

    then your Filter

    Filter(
     Collection3,
     'Created By'.DisplayName = Combobox1_1.Selected.FullName
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • SolTeferi Profile Picture
    on at

    Hi @Tango ,

     

    WarenBelz's solution should work if you have just one selection in the combobox. If you enabled 'Selectmultiple' and want to filter the gallery by all selected items in the combobox, you may want to use the following on the 'OnChange' event of the combobox. The following also uses the same string pattern as your combobxo items as you used only part of the display name there.

     

    Clear(collectionForGallery); ForAll(ComboBoxName.SelectedItems, With({varCombo:ThisRecord.Value}, Collect(collectionForGallery,Filter(Collection3,Left('Created By'.DisplayName,Find(" ",'Created By'.DisplayName)-1)=varCombo))));

     

    Then, use 'collectionForGallery' for the items property of your gallery.

  • Tango Profile Picture
    1,168 on at

    @WarrenBelz Thanks for your message.

     

    Im getting error in the items "function add columns has some invalid arguments. Received 2 expected 3 or more.

     

    Also don't understand what "Data" is for? (tried removing this and but problem still remained)

  • WarrenBelz Profile Picture
    156,327 Most Valuable Professional on at

    @Tango ,

    Just a stray comma (now removed) - you need Data (you can call it whatever you want) as it is a Table field with all the rest of the fields matching the grouped items.

     

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 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard