cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Dropdown default value - set to blank value?

I have an edit screen with two dropdowns controls.  The first dropdown is Client and the sceond is ClientProject.  After choosing the client, the user can seleect the specific project for the client.  The ClientProject dropdown is filtering it's list values based on the value of the Client dropdown.

 

When adding a new record, though, after I select a client, the Client Project dropdown always gets set to the first value on the list.  I would preer that it would be left blank.  Is this possible?

 

Thanks,

Dave

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Dropdown default value - set to blank value?

Ruth here is how you can recreate LookUp columns in SharePoint using PowerApps.This works across site collections also. 

 

For setting the default blank value I usually create a - as the first item in my list of choices and use that as the default. Not perfect but better than nothing. 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

View solution in original post

36 REPLIES 36
Highlighted
Helper II
Helper II

Re: Dropdown default value - set to blank value?

My suggestion is to put in the first cell of the column, a blank cell, without content.

Highlighted
Community Support
Community Support

Re: Dropdown default value - set to blank value?

Hi Dfin,

 

Are you configuring the two Dropdown controls on an Edit Form?
What functions are being used to the Dropdown controls?

 

Say you are configuring the two dropdown controls on an Edit form, so I created a SharePoint listC as my data source, then created an app based on this list automatically.
On the EditScreen, I customized the ClientName and ClientProject fields and added two dropdown controls to each of the two fields.
For ClientName, I set the Items property of the Dropdown control as ListC.Title
For ClientProject, I set the items property of the Dropdown control as Distinct(Filter(ListC,Title=Dropdown3.Selected.Value),OData__x0064_le0)

1.png

But it seems that we are not able to set the Default value of the Project field to Blank. When selecting an ClientName, the corresponding ClientProject would be shown. It seems that it cannot be Blank.

 

If I misunderstand you, please feel free correct me.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Kudo Kingpin
Kudo Kingpin

Re: Dropdown default value - set to blank value?

Hi @dfin @AvenaFernando @v-yamao-msft

Any updates on this query or do we still need to insert a blank row in our data source??

Thanks

Highlighted
Frequent Visitor

Re: Dropdown default value - set to blank value?

Good question @dfin, did you ever get it to work as wanted?

This is something I'm having some trouble to acomplish too, thus i'm trying to make this post become alive again.

 

I'd rather not make a "Blank" entry option, as this most likely would make my data having lower quality because people most certanly will end up submitting these blank values from time to time 😉

 

If someone know how to fix this i'd really like to hear about it.

 

All the best

H

Highlighted
Super User II
Super User II

Re: Dropdown default value - set to blank value?

Have you tried using a combo box instead of a drop down? The combo box doesn't select the first item as the default value.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
Frequent Visitor

Re: Dropdown default value - set to blank value?

Thanks for your reply @Jeff_Thorpe.

 

No I have not, I'm not even sure what an ComboBox is 🙂

 

But I was lucky to discover that if i wrote:

"Defaults('[MySharepointList]'.Blank())" into the field DefaultSelectedItems i get the desired result (I do get the yellow waring sign though).

 

H

Highlighted
Super User II
Super User II

Re: Dropdown default value - set to blank value?

I haven't test it out but it looks like the code example would make the field blank with an item is new and when you edit the item. Have you tested it out when editing an existing item?



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
Frequent Visitor

Re: Dropdown default value - set to blank value?

Thanks for your input, and I'll kepp it in mind.

 

No i have not done that, but you might be right, although, the form I'm usig it for is creating new items only and I think there is no danger for anyone to edit an item because I resets all fields in the form when opening this screen using the "newform" action (or what i should call it 🙂 ). Unless I miss somethin obvious.

 

This is my first App so i beg your pardon if I seem a bit dense 🙂

 

H

Highlighted
Resolver II
Resolver II

Re: Dropdown default value - set to blank value?

There are several ways to tackle what you are talking about I think.  If you like the idea of having blank by default but concerned with the data being saved as blank, there are ways to prevent that. An easy workaround, set the 'Visible' property of your submit form button to hide the button when the dropdown selection is 'blank'.

 

Perhaps the best solution for data integrity is to properly set up the data source validation and use the 'Validate' function of PowerApps to validate any records before attempting to save them, see here:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-validate

 

This would require the proper validation settings in the data source (i.e. the column set to not allow blanks, etc.).  I'm vaguely familiar with SharePoint lists, but it seems you can set up validation on a column in a list, and even provide an error message that is shown to the user when data doesn't validate. Once it's set up in SharePoint, using 'Validate' function in PowerApps will check the form fields and provide messages to the user when something isn't right.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

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 designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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