cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Regular Visitor

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

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

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

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

Highlighted
Regular Visitor

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

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (7,820)