cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
GuyTerry
Level: Power Up

Patch with Drop Down OnChange

I have a Gallery that is showing records from Table2:

 

Items = SortByColumns(Filter(Table2,'Quality order' = QualityOrderListGallery.Selected.'Quality order'),"Sequence",Ascending)

 

The Result column in this Gallery will show either a Drop Down, or a Text Input.

 

TestsGallery.jpg

 

The Text Input shows the value in the Result field of Table2. If the user changes the value, the updated value is written to the relevant record in Table2:

 

Default = ThisItem.Result

OnChange = Patch(Table2,ThisItem,{Result:ResultFreeText.Text})

 

I would like the Drop Down to behave the same way, but I am getting an error on the OnChange property:

 

Items = Filter(Table3,Test in ThisItem.Test)
Value = Result
Default = ThisItem.Result
OnChange = Patch(Table2,ThisItem,{Result:ResultDropdown.Selected})

 

The error on the OnChange property reads:

This type of argument 'Result' does not match the expected type 'Text'. Found type 'Record'.

 

How can I get the value which the user selects in the Drop down to be written back to Table2?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Patch with Drop Down OnChange

Hmm ok. Try SelectedText instead then. Then you should get the Text value from the dropdown.

 

OnChange = Patch(Table2,ThisItem,{Result:ResultDropdown.SelectedText.Value})

BR

Pontus

View solution in original post

5 REPLIES 5

Re: Patch with Drop Down OnChange

Hi!

 

Try to add .Value in the OnChange property. Like:

OnChange = Patch(Table2,ThisItem,{Result:ResultDropdown.Selected.Value})

 

BR

Pontus

GuyTerry
Level: Power Up

Re: Patch with Drop Down OnChange

That gives a slightly different error!

 

This type of argument 'Result' does not match the expected type 'Text'. Found type 'Error'.

Re: Patch with Drop Down OnChange

Hmm ok. Try SelectedText instead then. Then you should get the Text value from the dropdown.

 

OnChange = Patch(Table2,ThisItem,{Result:ResultDropdown.SelectedText.Value})

BR

Pontus

View solution in original post

Super User
Super User

Re: Patch with Drop Down OnChange

@GuyTerry 

When a dropdown is referenced in this way it returns a record (i.e. a row of data)

{Result:ResultDropdown.Selected}

 

I believe Result is a text column so you will have the reference the dropdown in a way that returns text

{Result:ResultDropdown.SelectedText}

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

GuyTerry
Level: Power Up

Re: Patch with Drop Down OnChange

Thank you both. SelectedText.Value gives me the behaviour I wanted 😀

Helpful resources

Announcements
thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,172)