cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

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
Highlighted
Resolver IV
Resolver IV

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
Highlighted
Resolver IV
Resolver IV

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

Highlighted
New Member

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'.

Highlighted
Resolver IV
Resolver IV

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

Highlighted
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."

Highlighted
New Member

Re: Patch with Drop Down OnChange

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

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (9,418)