cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Cmagee2433
Level: Powered On

Attempting to write a (toggle) value from a collection (derived from a Gallery) into a SQL database. Cannot figure out how to identify the record(s) to write to.

I have an EDIT screen with an EDIT form and a GALLERY at the bottom which brings back corresponding record(s) from a SQL database ('[shp].[MOBProductPO]_1'). The toggle within the gallery will be the only editable item wihtin the GALLERY. If the user swithes the toggle I need to be able to write back that value to the SQL Database.

 

So far the Submit button creates a Collection (POEdit) which holds the toggle values for each record in the gallery. 

 

What is the syntax to write those values back to their corresponding records within the SQL database? I can not figure out how to tell PowerApps which record.

Thas for any help

@Laura

1 REPLY 1
Community Support Team
Community Support Team

Re: Attempting to write a (toggle) value from a collection (derived from a Gallery) into a SQL database. Cannot figure out how to identify the record(s) to write to.

Hi @Cmagee2433 ,

Do you want to update records in PowerApps to SQL?

I suggest you use the combination of gallery and edit form.

1)Set the gallery's Items: tablename

2)inset an "add" button

3)set the "add" button's OnSelect: NewForm(Form1)

4)Set the edit form's data source: tablename

                                  Item: gallery1.Selected

5)Set the submitform's OnSelect: SubmitForm(Form1)

 

Then, if you click the "add"button, the form will be an empty form, you could enter data in it.Cilck the submit button, you will create a new record to SQL.

If you click the arrow button inside tha gallery , the form will load the item's data that you select.You could edit the data. Click the submit button, you will update the record that you select to SQL.

 

Here's a doc about it for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/working-with-forms

 

 

 

Best regards,

Community Support Team _ Phoebe Liu

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.

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 131 members 5,340 guests
Please welcome our newest community members: