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 / SQL patch data type error
Power Apps
Answered

SQL patch data type error

(0) ShareShare
ReportReport
Posted on by 7

I'm attempting to patch a data card value to a INT SQL column and I receive the following error. 

 

"The type of this argument 'clarityPersonalID' Does not match the expected type number. found type error"

 

The record I'm attempting to patch is  a data card in a form set up using the following. Also when I hove over the value it says data type number.

 

Value(ClarityPersonalID_DataCard1_value.Text)

 

 

Here is the full patch statement.

 

 

//SubmitForm(frmPersonal);
If(
IsEmpty(
Errors('[dbo].[tblClientID]',Patch('[dbo].[tblClientID]',If(varFormMode="New",Defaults('[dbo].[tblClientID]'),LookUp('[dbo].[tblClientID]',ClientID = var_CurrentClientID)), {FirstName: dcvPersonal_ClientFirstName_Value.Text, LastName: dcvPersonal_ClientLastName_Value.Text,ClarityPersonalID:ClarityPersonalID_DataCard1_value.text ,MiddleInitial: dcvPersonal_ClientMiddleInitial_Value.Text, Alias: dcvPersonal_ClientAlias_Value.Text, DateOfBirth: dcvPersonal_DateOfBirth_Value.SelectedDate, UpdateBy: varStaffID, LastUpdateDate: Now(), CreateBy: If(varFormMode = "New",varStaffID,dcvAddress_CreateBy_Value.Text), CreatedOnDate: If(varFormMode="New",Now(),dcvAddress_CreatedOnDate_Value.SelectedDate)}))
),
Notify("Data saved successfully",NotificationType.Success),
Notify("There is an error with your request",NotificationType.Error)
);

//Patch('[dbo].[tbl_ClientDemographic]',Defaults('[dbo].[tbl_ClientDemographic]'),{ClientID:var_CurrentClientID});

ResetForm(frmPersonal);

datacard.PNG
sql.PNG
Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Neil2 

    According to the second screenshot, you are updating the wrong control. Shouldn't it be datacard2

  • Neil2 Profile Picture
    7 on at

    Oh thank you for pointing that out I attached a old screenshot. I'm using the correct data card name.

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Neil2 

    Both the table value and the Update seem to be numbers so I don't see why it doesn't work.  I had two questions though

    • Why are you using a Patch() instead of just submitting the form? It seems counterproductive and I would try that to see if it still errors on that field.
      • You could put your notifications in the OnSuccess and OnFailure properties of the form.
    • Is the ClarityPersonalID value coming from the user or is it captured from somewhere else?

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard