How to Fix Power Apps Gallery Data Not Fully Saving to SQL
Question details
The user needs to resolve an issue where edited records in a Power Apps gallery are not completely saved to a connected SQL database table.

- Product
- Microsoft Power Apps
- Device & OS
- not provided
- Scenario
- Updating multiple records in a Power Apps gallery connected to a SQL database.
- Observed behavior
- Some or all edited records fail to save to the target SQL table during Patch or SubmitForm operations.
Before seeking further assistance, gather your exact Power Apps gallery configuration, including your Items property, OnSelect actions, Patch or SubmitForm formulas, and SQL database column definitions.
Consult the Official Power Apps Community
Because this issue involves complex Patch operations, gallery formulas, and SQL data types, the best approach is to have Microsoft specialists review your exact configuration.
Troubleshooting Power Apps gallery data connection issues often requires deep inspection of your application's internal code logic and the destination SQL Server environment. The Microsoft Power Apps Community has dedicated experts who can diagnose these granular formula errors.
Copy your exact Items, OnSelect, Patch, or SubmitForm formulas to a text document.
Note the specific data types and column definitions of your target SQL table, especially for the fields failing to save, and ensure the table has a defined Primary Key.
Navigate to the official Microsoft Power Apps Community at powerusers.microsoft.com.
Create a detailed post explaining that the gallery data is not fully saving to SQL, and paste the formulas and schema details you gathered to receive specialized help.

Verify Common Patch and ForAll Formula Errors
Reviewing the specific logic used to iterate through gallery items can sometimes uncover why only partial data is saved to the SQL database.
Try WPS Office for Your Daily Documentation and Data Needs
While WPS Office does not replace Power Apps for custom application development and SQL database integrations, it is a highly efficient, free alternative to Microsoft Office. It offers robust tools for creating text documents, spreadsheets, and presentations, providing a lightweight experience with familiar interfaces and excellent format compatibility.
- 1. Visit the official website: Go to the WPS Office website to download the latest free version for your operating system.
- 2. Install the application: Run the downloaded installer and follow the straightforward on-screen instructions to set up WPS Office on your device.
- 3. Open existing documents: Launch WPS Office and open your existing Microsoft Office files with full format compatibility.

Frequently Asked Questions
Why does Power Apps fail to update existing records in my SQL table?
Power Apps may fail to update SQL records if the target table lacks a Primary Key, if there is a data type mismatch between the app's input controls and the database, or if the Patch formula contains syntax errors.
How do I save all items from a Power Apps gallery to SQL at once?
To save multiple items simultaneously, you typically use the ForAll function combined with Patch, iterating over GalleryName.AllItems to send each modified record from the gallery back to the SQL data source.
Can a missing primary key in SQL affect Power Apps?
Yes, Power Apps explicitly requires a primary key on SQL Server tables to uniquely identify rows. Without it, the table is treated as read-only by the application, preventing any updates, deletions, or inserts.




