Announcements
https://powerusers.microsoft.com/t5/Building-Power-Apps/Getting-data-from-SQL-Server-table-with-composite-key/td-p/37774
I think the easiest thing to do is to create a single auto-incrementing, int (identity) column and to use that as your primary key.
I understand that you want to enforce uniqueness across those multiple columns so to do that, you can define a unique index rather than use a composite PK.
https://docs.microsoft.com/en-us/sql/relational-databases/indexes/create-unique-indexes?view=sql-server-ver15
✅If this helped, please Accept as Solution to help others ❤️ A Like is appreciated 🏷️ Tag @MS.Ragavendar for follow-ups.
Hi there!
The "Network error: The requested operation is invalid" with Patch typically means Power Apps cannot identify a unique record to write to — usually a missing or composite primary key issue.
Patch
Top causes and fixes:
1. Missing single primary key (most common) — Power Apps requires one auto-incrementing integer identity column as the primary key. If your SQL table uses a composite key or has no identity column, Patch cannot resolve the target record. Fix: Add an int IDENTITY column as the primary key. Enforce uniqueness across multiple columns with a separate unique index instead of a composite PK.
int IDENTITY
2. Invalid record reference in Patch — Make sure you are passing an existing record reference, not a manually constructed one. Use: Patch(DataSource, LookUp(DataSource, ID = someValue), { Field: Value })
Patch(DataSource, LookUp(DataSource, ID = someValue), { Field: Value })
3. Permissions — If using Dataverse, confirm the logged-in user has Create/Edit privileges on the table. Permission errors can surface as "invalid operation" errors.
📖 References:
Found this helpful? Please mark ✅ "Does this answer your question?" so others searching for the same issue can find it quickly. A 👍 on "Was this reply helpful?" or a ♥ Like is also much appreciated!
Raghav Mishra — LinkedIn | PowerAI Labs
Best regards, Valantis
✅ If this helped solve your issue, please Accept as Solution so others can find it quickly. ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :). 🏷️ For follow-ups @Valantis. 📝 https://valantisond365.com/
💼 LinkedIn
▶️ YouTube
Hi @DB-30121647-0,
Just wanted to check in and see if everything is working now. If you still need any help, feel free to let me know.
Also, if the issue is resolved, it would be great if you could mark the answer as solved so others with the same question can find it easily.
Thanks and have a great day!
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.
Jump in, show your community spirit, and win prizes!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Valantis 481
WarrenBelz 379 Most Valuable Professional
11manish 291