web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add Blank Value to Dro...
Power Apps
Answered

Add Blank Value to Drop down with SharePoint List Distinct

(0) ShareShare
ReportReport
Posted on by 1,387 Moderator

DrpItemType (drop down) has Items=Distinct(CHMerchandise,Title) and it works, but I'd like to add a blank value as the first option.

 

I also have DrpItemChosen (drop down) with 

 

Filter(
CHMerchandise,
Title = DrpItemType .Selected.Result
)

 

Which I would also like to have a blank value as the first option.

 

I have buttons that enable/disable based on if these fields are populated, and I don't want the default values to have items selected already.

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @IPC_ahaas 

    In the OnVisible property of the screen put ClearCollect(itms,{Result:Blank()};Collect(Distinct(CHMerchandise,Title)) and in the Items property of the dropdown: itms or without a collection put this formula directly in the Items property of the dropdown 

    Ungroup(
     Table(
     {myMenuOptions: Table({Result: Blank()})},
     {myMenuOptions: Distinct(CHMerchandise,Title).Result
     }
     ),
     "myMenuOptions"
    )

     

  • IPC_ahaas Profile Picture
    1,387 Moderator on at

    I get an error with Collect(Distinct(CHMerchandise,Title)) saying that it's expecting at least two values.

     

    Changing it to this seems to work:

     

    Collect(
         itms,
         {
              Result: Distinct(CHMerchandise,Title)
         }
    );

     

    While the latter code (Ungroup) works, I don't really understand what it's doing that makes it work.

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @IPC_ahaas 

    It should be

    ClearCollect(itms,{Result:Blank()};

    Collect(Result,Distinct(CHMerchandise,Title)) 

    As you figured out.

    The second formula does essentially the same without the collection.  For a better explanation  see https://www.matthewdevaney.com/how-to-add-a-blank-value-to-a-dropdown-list-in-power-apps/  

  • AlanJ88 Profile Picture
    2 on at

    Where did people get the itms from?

     

  • NPG87 Profile Picture
    7 on at

    i have a similar problem to solve, i have a dropdown list running 2 conditions to retrieve items for all departments or the one selected in OQ stream dropdown, but dont know how to add a blank to this list.

    Below is my coding for my existing dropdown list:
    Sort(
    ForAll(Distinct(
    // Filters any subtopics that are either area-specific or that are topic specific
    Filter(
    'Document List',
    //Filter by either an area selected or by "All"
    Or(
    Stream = 'OQ Stream'.SelectedText.Value,
    Stream = "All"
    )
    ),
    Title
    ), {Result: ThisRecord.Value}),
    Result
    )

  • IPC_ahaas Profile Picture
    1,387 Moderator on at

    Here is what my final coded ended up being:

     

    Ungroup(
     Table(
     {
     Items: Table({Result: Blank()})
     },
     {
     Items: ForAll(Distinct(CHMerchandise,Title), {Result: ThisRecord.Value}).Result
     }
     ),
     "Items"
    )

     

     Hopefully that is helpful.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard