Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Answered

Populate dropdown box with a person (displayname) from a sharepoint list, adding "All" to the list

(1) ShareShare
ReportReport
Posted on by 4
I have a gallery that I am trying to filter based on some criteria from some controls. Currently working on a filter for specific person using a regular dropdown box. (not a combobox)
 
In the screen's OnVisible, I have:
 
ClearCollect(
    colAuthors,
    {Result: "All"},
    Distinct('my_sharepoint_list','Created By'.DisplayName)
)
 
The Items property for the dropdown is set to colAuthors
The dropdown is named sel_author
The Items property for the gallery:
 
If(
    IsBlank(sel_author.Selected.Value) || sel_author.Selected.Result = "All",
    'my_sharepoint_list',
    Filter('my_sharepoint_list',Author.DisplayName = sel_author.Selected.Value)
)
 
When playing the app, the items populating the dropdown box are all 4 digit numbers instead of the string values I would expect. Functionally it all works. Can someone help me understand what I'm doing or not doing to get these numbers in my combobox instead of the actual displayname values with the "All" at the top? This is my first attempt at building a canvas app, so yes, the ClearCollect() idea above came from gpt, which has not been particularly helpful in troubleshooting this.
  • TS-18010022-0 Profile Picture
    TS-18010022-0 4 on at
    Populate dropdown box with a person (displayname) from a sharepoint list, adding "All" to the list
    Wow. Thank you Warren. That not only gets it working, it simplifies it a great deal. 
  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 145,567 on at
    Populate dropdown box with a person (displayname) from a sharepoint list, adding "All" to the list
    Firstly the output from Distinct is Value, not Result - you can also ditch the collection and make the Items of sel_author
    Table(
       {Value: "All"},
       Distinct(
          'my_sharepoint_list',
          'Created By'.DisplayName
       )
    )
    Then the Items of the Gallery
    Filter(
       'my_sharepoint_list',
       sel_author.Selected.Value = "All" ||   
       Author.DisplayName = sel_author.Selected.Value
    )
    Also if that is a Modern Combo Box and it still does not work, try this on a Classic item.

    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,567

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard