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 / Submit/PatchingAzure S...
Power Apps
Suggested Answer

Submit/PatchingAzure SQL table with Composite Key from canvas app

(1) ShareShare
ReportReport
Posted on by 26
Hi everyone, 

I have an Azure SQL Database with several tables, almost all of which have been set up with a Compound Primary Key.  I was unable to submit a form or patch from my PowerApp.

I know that several years ago whilst looking to test using SQL I ended up creating an Identity column in the table as Primary Key which then worked.

As I may not have the option to do this on this occasion I wanted to understand if it was possible to patch to an azure SQL table that uses a Compound key, I am assuming that regardless, the submit function wont work and that it would have to be  a patch.

Table Schema Example - Bold signifies Compound Primary Key

BusinessNameID - Nvarchar
EffectiveDateTime - DateTime
BusinessNameDescription
BusinessNameOwner
Approved
Active
InActiveDateTime
 
Categories:
I have the same question (0)
  • Suggested answer
    Pstork1 Profile Picture
    69,556 Most Valuable Professional on at
    You might get it to work with a composite key, but not if part of the key is Date/Time.  The normal workaround is to either use a stored procedure, which you can call from a Power App, or call a Power Automate flow.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Moores35TFL Profile Picture
    26 on at
    I was able to get a patch statement to work by using a lookup to get the record, although I accidentally removed the line of code and have struggled to make it work again.   I am considering having an IDENTITY integer Column added to the table, but stll wish to retain the 2 fields above (BusinessNameID - Nvarchar
    EffectiveDateTime - DateTime) as the composite key - is it possible to utilise the IDENTITY Column without making it a Primary key or part of the composite key.

    its main purpose is to just identify the specific record, to conduct the patch statement

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard