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

38 REPLIES 38

@strategery 

This is great thanks - but it doesn't throw validation error if the field is required...?

@beebul I assume you're talking about my method for "(choose one)"? Somewhere in my posts I mentioned I rarely use the actual forms, so typically I hide the submit button if "(choose one)" is still the selected item.

 

If you use forms and use my method(as below) to put a blank value up front, validation would still work.

 

Screen.OnVisible = ClearCollect(CollectionName, {Fieldname: ""}, DataSource)
Dropdown.Default = ""

(With Items set to <CollectionName> and Value set to <Fieldname>)

 

@strategery  - thanks for the tips very useful, I still can't get it to throw the validation error though 😞

 

I think it maybe because I'm trying to do a patch on the UPDATE for the field..? But not sure why that would affect it?


@beebul wrote:

@strategery  - thanks for the tips very useful, I still can't get it to throw the validation error though 😞

 

I think it maybe because I'm trying to do a patch on the UPDATE for the field..? But not sure why that would affect it?


Well I attempted with a basic SharePoint list and using the SharePoint > PowerApps feature to build a basic form app, so you may have to provide more info about your app. I had trouble myself getting Validate function to work.  Since it's more related to validation, you might make a new topic if you really need it to work, the more people you can reach the better.

Phelzier
New Member

Bit of a late reply and maybe I'm missing something.


For me I get a default blank by selecting the dropdown box and setting AllowUnsetValue=true

This then makes the field default blank, then you set it to be Required so that the user needs to select a value from the list.

 

Again, I know it's an old post and maybe there's been an update since the post was created.

Anonymous
Not applicable

@Phelzier  thanks for your input. I dont understand it all, cause as i wrote some time back in this post suddenly everything worked for me as intended without me doing anything.

After that it seemed to me the discussion kind of took a turn and bacame not really what I asked about, but notheless interesting.

 

I think i'm just going to mark your answer as a solution as i think your answer seems like a nice solution (i have not even tried it) but face value alone does it for me in this case 🙂

Anonymous
Not applicable

Well, this was kind of embarrasing, I thoght I answerd on another topic, so disregard my last post please 🙂 I belived I created this topic - something I did not 😮

Alex_Boom
Regular Visitor

There has been an update recently what fixed this problem.

 

Just go to the advanced settings of your dropdown and set the AllowUnsetValue to true

Now set as Default value the "" 

 

Schermafbeelding 2019-05-13 om 16.10.59.png

 

 

 

 


It should work and looks like this:
Schermafbeelding 2019-05-13 om 16.18.14.png

This is great... That is exactly how I expected it to work.

There needs to be a better way than just adding blanks in your data source. Possible solutions I've thought of but haven't gotten to work ... both require adding values to filtered results which I have not figured out how to do yet. 

 

1. On the "Items" add in a [Blank()] or [""] or [Empty()] to the filtered results;

ITEMS : Filter([Table], ITEM = VAR) && [Blank()]

 

2. Create a seperate list with just one or two blanks and somehow add the two lists together

 

Option 1 would be ideal ... any way this could work?

 

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (59,694)