cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JMikhail
Regular Visitor

Unable to save any data to an Azure-hosted SQL Server database

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:

 

Ssms_pqPHXgEfFx.png

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:

 

vivaldi_mvBQpfbfvZ.png

 

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.

 

vivaldi_McC5Cw49Ql.png

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!

1 ACCEPTED SOLUTION

Accepted Solutions
JMikhail
Regular Visitor

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:

vivaldi_gDArHJ1WTR.png

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.

View solution in original post

2 REPLIES 2
eka24
Super User
Super User

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

JMikhail
Regular Visitor

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:

vivaldi_gDArHJ1WTR.png

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.

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 (1,339)