cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DAVIDPOWELL
Post Prodigy
Post Prodigy

Patch from combobox to sql server was using dropdown

I have a gallery:

Inside the gallery i have a dropdown: i was asked to change to combobox so they can search for the value. 

 

I have  when "OnSelect" for a dropdown was using this :

Patch('[dbo].[Entity_Base_Information]',ThisItem,{QB_NAME: Newqb_ddwn.Selected.Result})

 

I need now to use a combobox for "onselect" : and was trying to use this same code ?

Patch('[dbo].[Entity_Base_Information]',ThisItem,{QB_NAME: Newqb_ddwn_cbo.Selected.Result})

getting an error message ?

 

Dave

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@DAVIDPOWELL 

Very good.  But consider what I mentioned - you are patching as soon as a person selects the Combobox.  I believe you would want to put this on the OnChange action as it is potentially likely that there is no Selected item at the point that the user selects the control.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
RandyHayes
Super User
Super User

@DAVIDPOWELL 

What is the error message?  And what is the Items property of the combobox?  Based on your formula you show, it should be based on Distinct in the items.

Also, are you sure you want to perform this in the OnSelect?  That means when the user clicks on the control, your action will occur.  I would suspect you would want this to be more on the OnChange.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

i got it worked out:

ITEMS = Distinct('[dbo].[Entity_Base_Information]',QB_NAME)
ONSELECT = Patch('[dbo].[Entity_Base_Information]',LookUp( '[dbo].[Entity_Base_Information]', ID_Num = Value(ID_NUM_LBL.Text)),{QB_NAME: Newqb_ddwn_cbo.Selected.Result})

RandyHayes
Super User
Super User

@DAVIDPOWELL 

Very good.  But consider what I mentioned - you are patching as soon as a person selects the Combobox.  I believe you would want to put this on the OnChange action as it is potentially likely that there is no Selected item at the point that the user selects the control.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,990)