cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JillH Helper II
Helper II

Dropdown Selection Changing Unexpectedly

Hi all - everyone has been so helpful here - hoping for another save!

 

I have a dependent drop-down set up in my App. User selects a Team, then a list of Project Types pops up. Both are dropdowns in a datacard that write the value as text to a single line of text entry in a sharepoint site. Sometimes - definitely not all the time - the value of the second one will display and save incorrectly. When you hit "Edit all" within the form, it reverts to the correct selection. But, the saved value is wrong. 

 

Is there something I'm missing? An If Statement? or ? Thanks for any help!

 

Example:

On Open - Wrong Project Type

image.png

 

 

On Edit - Correct Project Type (so clearly, it's storing that correct value... somewhere)

image.png

 

 

Code for the Type dropdown:

Item:

Distinct(Filter(BI_Project_Types,Title=RoleDropDown.SelectedText.Value),Project_x0020_Type)

Default:

ThisItem.'Project Type Output'

No OnChange or OnSelect

 

Code for that Datacard:

Update:

TypeDropDown2.SelectedText.Result

 Default:

ThisItem.'Project Type Output'

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Dropdown Selection Changing Unexpectedly

Hi @JillH ,

Do you mean that Role/Team and Project Type data both come from another list called BI_Project_Types?

Try this:

1)Role or team:

The drop down's Items:

Distinct(BI_Project_Types,Role or Team)
//I notice that the field is called 'Role or Team', why you use "Title"?

The drop down's Default:

ThisItem.Requestor Role or Team
//I assume this field is named 'Requestor Role or Team' in current list

The datacard's Update:

RoleDropDown.Selected.Result

Set the drop down's OnChange:

Reset(TypeDropDown2)

2)Project Type:

The drop down's Items:

 

Distinct(Filter(BI_Project_Types,Role or Team=RoleDropDown.Selected.Result),Project_x0020_Type)

 

The drop down's Default:

 

ThisItem.'Project Type Output'

 

The datacard's Update:

 

TypeDropDown2.Selected.Result

 

 

Since this form is related to two lists, you need to connect with these two lists.

Since your data sometimes display correctly, sometimes not. This may be related to not updating data source in time.

You could set the SharePoint intergation:

OnEdit:

Refresh(list1);Refresh(list2);EditForm(Form1)
//replace with your lists and form names

OnView:

Refresh(list1);Refresh(list2);ViewForm(Form1)
//replace with your lists and form names

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
eka24 Community Champion
Community Champion

Re: Dropdown Selection Changing Unexpectedly

What is in the Items property of the first dropdown
JillH Helper II
Helper II

Re: Dropdown Selection Changing Unexpectedly

Ah - this:

Distinct(BI_Project_Types,Title)
eka24 Community Champion
Community Champion

Re: Dropdown Selection Changing Unexpectedly

I have adjusted the formula a little bit. Wondering why the second dropdown is also being Distinct:
Filter(BI_Project_Types,Title=RoleDropDown.Selected.Value)

If you like this post, give a thumbs up. Where it solved your issue, Mark as a solution
Community Support
Community Support

Re: Dropdown Selection Changing Unexpectedly

Hi @JillH ,

Is pic1 a display form, pic2 an edit form?

Do you mean that the display form could not display right data, while the edit form could?

Could you tell me the data type of Project_x0020_Type column and Title column?

Did you customize the edit form to make drop downs to choose the value of Project_x0020_Type column and Title column instead of using textinputs?

I assume that both of them is text type and you make customization like what I said.

Actually, you do not need to set the display form like what you said.

You just need to customize the edit form, the display form retaining the default settings is ok.

 

 

Usually, we set display form like this:

1)set the form's data source: 

 

BI_Project_Types

 

2)set the form's Item: the item that you want to edit   (for example: Gallery1.Selected)

As the Project_x0020_Type column and Title column, you do not need to make any customization. Just using the default labels is enough.

 

The labels' settings should be like this:

1)Project_x0020_Type column

datacard's Default: 

 

ThisItem.Project_x0020_Type

 

//question:  what is the relationship between Project_x0020_Type column and 'Project Type Output' column?

label's Text:

 

Parent.Default

 

2)Title column

datacard's Default: 

 

ThisItem.Title

 

label's Text:

 

Parent.Default

 

 

 

 

 

Then in the edit form, you could make customization on these two columns.

For example:

Delete labels in these two datacards, insert two drop downs.

1)Title column:

datacard's Update:

 

RoleDropDown.Selected.Result

 

drop down's Items:

 

Distinct(BI_Project_Types,Title)

 

drop down's Default:

 

ThisItem.Title

 

2)Project_x0020_Type column:

datacard's Update:

 

TypeDropDown2.Selected.Result

 

drop down's Items:

 

Distinct(Filter(BI_Project_Types,Title=RoleDropDown.Selected.Result),Project_x0020_Type)

 

//please notice that use "RoleDropDown.Selected.Result" represent the selection of title drop down, since you use Distinct function as its Items.

drop down's Default:

 

ThisItem.Project_x0020_Type

 

 

 

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
JillH Helper II
Helper II

Re: Dropdown Selection Changing Unexpectedly

Thanks! I'll need to read through it a couple times to make sure I'm capturing all of it!

As to the reasoning - I have a list of all the Roles on the team, and all the Project types associated with those roles. There are multiple duplications in both lists, hence the Distinct. Here's the source:

image.png

 

 

 

 

 

 

 

 

 

 

 

In order to narrow down both, I have the drop downs source from these two lists, then the output gets written to Project Type Output.

Community Support
Community Support

Re: Dropdown Selection Changing Unexpectedly

Hi @JillH ,

Do you mean that one 'Role or Team' value may correspond to different 'Project Type' value?

If so, I think my formula is enough, no need to use 'Project Type Output' field value.

If you still have problems, you're welcome to post your idea here.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
JillH Helper II
Helper II

Re: Dropdown Selection Changing Unexpectedly

Hi - I'm back at it. 

 

So - the source for both Role/Team and for Project Types is different from the rest of the form. Most of the form is connected to a SharePoint list. Then there is a separate list for Role and Types. there are multiple duplicate Roles and multiple duplicate Types. 

 

With other fields, I just use the out of the box data fields. But since these source and I want them to be dependent, the "easiest" way I could figure out how to do it was to have the PowerApp drop-down write the results to the text field for Project Type Output. 

 

I think I'm also a little confused on the method outlined above because I don't have a Display Form vs Edit Form because it's sourced/created from SharePoint. Or it could be, that I'm just not understanding what to do! 

 

It's still changing the result for some users 😞

Community Support
Community Support

Re: Dropdown Selection Changing Unexpectedly

Hi @JillH ,

Do you mean that Role/Team and Project Type data both come from another list called BI_Project_Types?

Try this:

1)Role or team:

The drop down's Items:

Distinct(BI_Project_Types,Role or Team)
//I notice that the field is called 'Role or Team', why you use "Title"?

The drop down's Default:

ThisItem.Requestor Role or Team
//I assume this field is named 'Requestor Role or Team' in current list

The datacard's Update:

RoleDropDown.Selected.Result

Set the drop down's OnChange:

Reset(TypeDropDown2)

2)Project Type:

The drop down's Items:

 

Distinct(Filter(BI_Project_Types,Role or Team=RoleDropDown.Selected.Result),Project_x0020_Type)

 

The drop down's Default:

 

ThisItem.'Project Type Output'

 

The datacard's Update:

 

TypeDropDown2.Selected.Result

 

 

Since this form is related to two lists, you need to connect with these two lists.

Since your data sometimes display correctly, sometimes not. This may be related to not updating data source in time.

You could set the SharePoint intergation:

OnEdit:

Refresh(list1);Refresh(list2);EditForm(Form1)
//replace with your lists and form names

OnView:

Refresh(list1);Refresh(list2);ViewForm(Form1)
//replace with your lists and form names

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (8,102)