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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / SQL Form not submitting
Power Apps
Unanswered

SQL Form not submitting

(0) ShareShare
ReportReport
Posted on by 158

See the image below, I'm not sure why I'm getting an error.

 

I have a Gallery (datasource is a SQL database called Pipeline), where I'm using an icon to Set(varPipeline, ThisItem).

I have a form, data is set to Pipeline - and item is set to varPipeline.  However, when I run SubmitForm(Form1)), I get the error below.  Any ideas?

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    on at

    Hi @Connor55 ,

    Could you please show more details about the error message within your "Submit" button?

    Have you defined a proper Primary Key within your SQL Table ('[dbo].[Pipeline]')?

     

    Firstly, please make sure you have defined proper Primary Key within your SQL Table. It is known limits with SQL Server connector in PowerApps, please check the following article for more details:

    https://docs.microsoft.com/en-us/connectors/sql/#known-issues-and-limitations

     

    If you want to use a Edit form to edit the selected item within the Gallery, I think it is not necessary to initialize a variable to store the selected item in your Gallery. Please take a try with the following workaround:

    Set the Items property of the Gallery to following:

    '[dbo].[Pipeline]'

     

    Set the DataSource property of the Edit form to following:

    '[dbo].[Pipeline]'

    set the Item property of the Edit form to following:

    Gallery.Selected

    Please take a try with above solution, check if the issue is solved.

     

    Also please check if you have defined some Required fields in your SQL Table, if so, please make sure you have enabled them within your Edit form, and provide proper values for these Required fields.

     

    In addition, you could also consider submit the form data back to your SQL Table using Patch function instead of SubmitForm function. Set the OnSelect property of the "Submit" button to following:

    Patch(
     '[dbo].[Pipeline]',
     Gallery1.Selected,
     Form1.Updates
    )

    or

    Patch(
     '[dbo].[Pipeline]',
     LookUp('[dbo].[Pipeline]', 'Primary Key Column' = Gallery1.Selected.'Primary Key Column'),
     Form1.Updates
    )

     

    Please consider take a try with above solution, then check if the issue is solved.

     

    Best regards,

  • Connor55 Profile Picture
    158 on at

    @v-xida-msft 

    Thanks for the help!  I have no idea what changed - but it's all working fine now.  

  • v-xida-msft Profile Picture
    on at

    Hi @Connor55 ,

    Have you solved your problem?

    Is the solution I provided above helpful in your scenario?

     

    If you have solved your problem, and the solution I provided above is helpful in your scenario, please consider go ahead to click "Accept as Solution" to identify this thread has been solved.

     

    Best regards,

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard