cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
vranjan22
Level 8

Default Dropdown Value Not Working?

Hi,

 

Database: MS SQL Server

 

I have created a form to submit new entries and another form to edit those entries. I am using drop downs for entering and editing data tables. 

 

Following properties have been set on the dropdowns in the edit mode:

 

Items: Reference to respective list tables stored in SQL server

Default: Parent.Default

Displaymode: Parent.Displaymode

 

The challenge is that when I open the form in edit mode, certain dropdowns does not show the default value but shows the first value in the dropdown list. For example, lets say one of the field is MaritalStatus. The respective list table has following entries: 

  • Single
  • Married
  • Divoreced
  • Widowed

If the record I am editing using the form has MaritalStatus stored as Married, the dropdown in the edit mode shows me Single.

 

Same settings are working fine in other fields, but not giving desired results in few.

 

I have tried using ThisItem.MaritalStatus as the Default field setting for the dropdown, but still not getting the desired results.

 

Please help.

 

Thanks!

Vivek

 

 

 

 

 

 

4 REPLIES 4
BenFetters
Level 8

Re: Default Dropdown Value Not Working?

Have you tried using your default formula in the default selected items? That has worked for me on occasion.

vranjan22
Level 8

Re: Default Dropdown Value Not Working?

Hi @BenFetters

 

Thank you for your response.

 

I am not sure which setting of dropdown control you are reffering to. If you are talking about Default property under Data, then I have already used Parent.Default and ThisItem.FieldName and still the dropdown displays the first value in the list.

 

As mentioned earlier, same settings are working fine in case of other dropdowns I have used in the form.

 

I am not sure if this is a bug in the system, becuase I had faced similar issues earlier, but it used to get resolved on thier own in a day or two. This time it is not happening.

 

This questions the credibility of PowerApp.

 

Thanks,

Vivek

BenFetters
Level 8

Re: Default Dropdown Value Not Working?

Oh okay, I understand now.

 

I'm not sure what it could really be then. And yes I was referring to the DefaultSelectedItems property of the dropdown but it looks like you've already tried that. One thing that you could maybe do that's sort of a fix is put in a laber directly over the dropbox, set it's font and everything to the same as the dropbox and then set it's text value to what you want the dropbox to show. Then, to not show the label and just show the dropbox, you could set the visibility of the label to only show when the form is in view mode. I can see a few reasons why this might not work or be ideal, but you could give it a shot maybe? 

 

Best of luck,

Ben

AndySid
Level 8

Re: Default Dropdown Value Not Working?

Hi,

You can try setting the default value via a variable. 

 

UpdateContext({mStatus: MaritalStatus.Selected.Value})

 

You then set the default value to mStatus