I have been trying to update all the data of a gallery. I'm using a SQL server to store all the data.
The gallery is in this format:
I tried to update using the functions Update and UpdateIf, but I did not get the result I was expected.
Using UpdateIf (condition: true -affecting all the table) all the records was updated to the last record.
Using Update I get a error id is needed, but when I add the ID another error shows saying id is generated by the server... (id is a PK from the table and is auto incremental)
Do you know how can I do to uptade the table?
Thank you for your time.
Go to Solution.
HI @Anonymous ,
Do you want to update all data within your Gallery into your SQL Table via pressing a "Submit" button?
Based on the needs that you mentioned, I think the Update() function and UpdateIf() function both could not achieve your needs.
I think the combination of ForAll function and Patch function could achieve your needs. I have made a test on my side, please take a try with the following workaround:
Set the OnSelect property of the "Submit" button to following formula:
RenameColumns(Gallery1.AllItems, "id", "id1"), /* <-- id represents the primary key column in your SQL Table */
LookUp('[dbo].[YourSQLTable]', id = id1),
Note: The TextInput1, Dropdown1, TextInput2, ... represents the corresponding controls within your Gallery.
More details about the ForAll function and Patch function in PowerApps, please check the following article:
The user @Helen_BB has faced same issue with you, please also check the response within the following thread:
View solution in original post
Fill out a quick form to claim your user group badge now!
Find out where you can attend!
Features releasing from October 2019 through March 2020
Learn how to build the business apps that you need.