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 / RowID unique identifie...
Power Apps
Answered

RowID unique identifier - patch(

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello, 

 

I've added a button to PATCH some results back into the sql Db - I am receiving an error. 

 

The ROWID is a primary key and a uniqueidentifier, i require it to generate a new one on the Db side when i OnSelect the button with the updated values.

db1.png
button.png
Categories:
I have the same question (0)
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    If it's an auto generated number, you shouldn't have to include it in your Patch function. Have you tried without it?

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

    Thanks!
    Hardit Bhatia
    The Power Addict
    https://thepoweraddict.com
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    @Anonymous 

    I recommend you set the ROWID field to be auto-generated, then there is no need to Patch this field.

    Please try to set the Default value of ROWID column to (newid()).

    Snipaste_2020-02-12_15-48-29.png

    Sik

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you for the reply, unfortunately, this still hasn't worked. I'll just rewrite the issue for abit more sense.

     

    - We're trying to join a Server Name/Server UID & App Name/App UID in table

    - When we Patch the 4 items together they shall be placed in 1 row with a ROWID at the end.

    - ROWID is a primary key and a uniqueidentifier, this has (newid()) in the default value or binding.

     

    The idea is to press a button and the 4 fields application_name, application_uid, server_name, server_uid will be added to the table with a new autogenerated primary key uniqueidentifier in the ROWID column.

     

    Button Code (this returns ROWID: Field is required)

    Patch('[dbo].[Apptable]', Defaults('[dbo].[Apptable]'), {Application_Name: AppName_Return.Text, Application_UID: AppUID_Return.Text, Server_Name: ServerName_Return.Text, Server_UID:ServerUID_Return});

     

    Button Code (with ROWID set as ROWID: Blank() returns ROWID: field is required)

    Patch('[dbo].[Apptable]', Defaults('[dbo].[Apptable]'), {ROWID: Blank(), Application_Name: AppName_Return.Text, Application_UID: AppUID_Return.Text, Server_Name: ServerName_Return.Text, Server_UID:ServerUID_Return});

     

    Button Code (with ROWID set as ROWID: GUID()  returns server response: clientrequestid: a value must be provided for item then gives a unique identifier number)

    Patch('[dbo].[Apptable]', Defaults('[dbo].[Apptable]'), {ROWID: Blank(), Application_Name: AppName_Return.Text, Application_UID: AppUID_Return.Text, Server_Name: ServerName_Return.Text, Server_UID:ServerUID_Return});

     

     

    - Application_name, Application_UID Server_Name, and Server_UID, ROWID are columns in the table

     

    db-1.png
  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

     I made a test based on your configuration, but don't have the issue you mentioned.

    'employee_id' is the primary key, unique identifier and auto-generated in Employee Table.  When I try to patch GUID() to 'employee_id' field, it works well.

    Could you please try to Delete the SQL connection and Re-add it to check if the issue is fixed?

    Also, I suggest you create a new App to debug this issue.

    Sik

     

    Snipaste_2020-02-13_13-32-04.png

    @Anonymous

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 936

#2
Valantis Profile Picture

Valantis 604

#3
11manish Profile Picture

11manish 518

Last 30 days Overall leaderboard