cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dfin
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

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

39 REPLIES 39
AvenaFernando
Helper II
Helper II

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

v-yamao-msft
Community Support
Community Support

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.

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

Anonymous
Not applicable

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

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.
Anonymous
Not applicable

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

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.
Anonymous
Not applicable

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

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,425)