I have a Power App connected to an Azure-hosted SQL Server instance, and while I can read data, all my attempts to save data have failed. The data is defined as follows:
OrganizationID is an identity field and automatically assigned. I created a few records with dummy data for testing. My first issue is that I have found that any fields defined as int or smallint were being loaded as blank, regardless of their values. I had to switch everything to numeric to get them loading properly, though that's not even my biggest issue. My data source is active, as seen here:
Now, my screens and forms can read and display the data just fine, but I can't update or create any records. I struggled for a while with trying to Patch an existing record, but kept getting a "record not found" error no matter how I tried to identify the record. So, as a process of elimination, I tried using Patch with Defaults in order to create a new record to see if that works.
And it doesn't. I don't understand how the resource can not be found if data is being loaded and displayed from it. I've also confirmed that DataSourceInfo('[dbo].[Organizations]', DataSourceInfo.CreatePermission) and DataSourceInfo('[dbo].[Organizations]', DataSourceInfo.EditPermission) are both true, so this isn't a permission issue.
Honestly, debugging in Power Apps has been a frustrating experience, and I'm hoping someone here can shed some light on this?
Thanks!
Solved! Go to Solution.
I tried everything to resolve this issue. Creating new databases, creating new tables, creating new apps with simple view forms, and no matter what I did, some fields would be populated and others would not be, completely randomly and intermittently.
After banging my head against a wall for a while, I stumbled on another thread that finally identified the problem:
As soon as I turned off this option in Settings -> Advanced Settings -> Preview Features, everything started working correctly. I have no idea what this is set to On by default, as it is obviously glitched with certain environments.
Posting in case it helps others in the future.
Well i will advice as follows:
1. your datasouce does not allow null " " for some of the columns. watch out example "OrgDesigName" but in your patch, is blank
2. if it doesnt work, use form instead of direct patch to see it can make any difference
3. I use Azure SQL a lot
Give Thumps up if it help. Mark as solution if it solved your question
I tried everything to resolve this issue. Creating new databases, creating new tables, creating new apps with simple view forms, and no matter what I did, some fields would be populated and others would not be, completely randomly and intermittently.
After banging my head against a wall for a while, I stumbled on another thread that finally identified the problem:
As soon as I turned off this option in Settings -> Advanced Settings -> Preview Features, everything started working correctly. I have no idea what this is set to On by default, as it is obviously glitched with certain environments.
Posting in case it helps others in the future.
User | Count |
---|---|
157 | |
86 | |
68 | |
63 | |
61 |
User | Count |
---|---|
211 | |
152 | |
93 | |
81 | |
70 |