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 III
Super User III

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (3,205)