web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / PowerApps to SQL Serve...
Power Apps
Answered

PowerApps to SQL Server Form

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

I've created a PowerApps form to add a row to a table in a SQL Server database.  The form mode is set to "New".  Here is the UsbmitForm statement: SubmitForm(FORMTargetTable);Refresh('[dbo].[TargetTable]');ResetForm(FORMTargetTable).

 

There are seven data cards (each for a required field in the target table) with associated controls.  Five controls use dropdown lists to limit data entered.  Lists are sourced from other tables within the SQL Server database.  The structure for each data card is DataCard1.Update.Field1.TargetTable from DropownX.FieldX.SourceTable.

 

Update statements for each data card with a dropdown are: DropdownX.Selected.FieldX.  An earlier version had the update parameter set to [dbo].[TargetTable].[Field1].

 

The SubmitForm statement for the button control is: SubmitForm(FORMName);Refresh('[dbo].[TargetTable]');ResetForm(FORMName)

 

When I click the button to submit the form, I get an error message that the data card associated with the first dropdown list has no data despite having made a selection.  My guess is if this data card is fixed, the next in line will have the same issue.  I suspect dropdown selection aren't being passed through the update parameter of the data card.

 

Any suggestions for how to overcome this?  I've looked at Patch but don't think it should be needed for this app as this is a one screen app pushing data to a single table in SQL Server.

 

Thanks.

Categories:
I have the same question (0)
  • jlmiller35 Profile Picture
    Microsoft Employee on at

    One correction to SubmitForm, instead of it saying FORMTargetTable it should say FORMForm1.

  • Verified answer
    jlmiller35 Profile Picture
    Microsoft Employee on at

    Thanks for the response.  Since posting the original question, I found my mistake in first building the form.

     

    On the data cards with the dropdown lists, I had removed the Data Value controls.  Removing those cards and placing new ones, I added the dropdowns and set the update parameter for the data card to: DropdownName.Selected.DropdownDataElementName.

     

    This change passed the dropdown selection to the data value which is what SubmitForm picks up.  Now, once selections are made and all required fields completed, clicking the button to accept adds a new record to the SQL Server database.

     

    Now if I can only recreate the app for online use with a direct query to the database.  But that's another topic.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard