Power Apps Patch Error: The type of this argument ‘Attributes’ does not match the expected type ‘Record’. Found type ‘Text’

In this Power Apps tutorial, I will show you how to fix an error, i.e., The type of this argument ‘Attributes’ does not match the expected type ‘Record’. Found type ‘Text’. The function ‘Patch’ has some invalid arguments that occur when working with the Power Apps Patch function.

I recently had to build a Power Apps canvas app using various Modern controls. There, I needed to save the user-provided data into the Power Apps Collection. While I used the Power Apps Patch function on the Submit button, I got the above Patch function error.

does not match the expected type record in power apps

We’ll now explore this issue in more depth and offer some solutions for you to follow.

The type of this argument ‘Attributes’ does not match the expected type ‘Record’. Found type ‘Text’ – Power Apps Error

  • Here, I have a SharePoint List named Product Details. As shown below, this list includes several columns and records. Such as:
ColumnData type
Product IDTitle column with a Single line of text
Product NameSingle line of text
AttributesChoice
QuantityNumber
PriceCurrency
Customer NameSingle line of text
LocationSingle line of text
Product ImageImage
Sales DateDate time
Is Order ReceivedYes no

Refer to the screenshot below.

the type of this argument does not match the expected type powerapps
  • In Power Apps, I created a Power Apps Collection (colProductInfo) and stored all the values from the above SharePoint list.
  • Next, I have added some of the Power Apps Modern Controls, such as Text, Text Input, Dropdown, Date Picker, and Checkbox, within a Rectangle control.
  • Additionally, the Power Apps Modern Button control helps save data in the Power Apps collection. And to save it, I used the Power Apps Patch function.
  • I have applied the code below to the Button’s OnSelect property:
OnSelect = Patch(
    colProductInfo,
    Coalesce(
        varItemData,
        {
            Title: "",
            ProductName: "",
            Attributes: "",
            Quantity: "",
            Price: "",
            SalesDate: Blank(),
            CustomerName: "",
            IsOrderReceived: ""
        }
    ),
    {
        Title: TextInputCanvas1.Value,
        'Product Name': TextInputCanvas1_1.Value,
        Price: Value(Text(TextInputCanvas1_3.Value)),
        Quantity: Value(Text(TextInputCanvas1_2.Value)),
        'Sales Date': DatePickerCanvas1.Value,
        'Customer Name': TextInputCanvas1_4.Value,
        'Is Order Received': CheckboxCanvas1.Checked,
        Attributes:DropdownCanvas1.Selected.Value
    }
)

Where,

  1. colProductInfo = Collection name that is created before
  2. varItemData = Variable name
  3. Title, ProductName, Attributes, Quantity, and so on = SharePoint Column names
  4. TextInputCanvas1, TextInputCanvas1_1, TextInputCanvas1_2, and so on = Modern Text input Control names

But whenever I wrote the above code and try to run it by clicking the SUBMIT button, I got a Power Apps error “The type of this argument ‘Attributes’ does not match the expected type ‘Record’. Found type ‘Text’. The function ‘Patch’ has some invalid arguments“.

does not match the expected type record in power apps

In the section below, we will explore how to resolve the issue mentioned above using the Power Apps Patch function.

The type of this argument ‘Attributes’ does not match the expected type ‘Record’. Found type ‘Text’ – Solution

When I encountered this problem, I searched the internet for details and visited a few relevant websites. However, I found a solution and implemented it. My issue was soon rectified, and I continued as necessary.

  • The above error clearly states that the argument ‘Attributes’ does not match the expected type ‘Record’. Found type ‘Text’. That means Attributes is a SharePoint Choice Column and you need to pass this choice column with a proper format, i.e., Attributes: {Value: DropdownCanvas1.Selected.Value}.
  • We can not directly specify the SharePoint Choice value like DropdownCanvas1.Selected.Value. This is the only difference. Refer to the correct formula below:
OnSelect = Patch(
    colProductInfo,
    Coalesce(
        varItemData,
        {
            Title: "",
            ProductName: "",
            Attributes: "",
            Quantity: "",
            Price: "",
            SalesDate: Blank(),
            CustomerName: "",
            IsOrderReceived: ""
        }
    ),
    {
        Title: TextInputCanvas1.Value,
        'Product Name': TextInputCanvas1_1.Value,
        Price: Value(Text(TextInputCanvas1_3.Value)),
        Quantity: Value(Text(TextInputCanvas1_2.Value)),
        'Sales Date': DatePickerCanvas1.Value,
        'Customer Name': TextInputCanvas1_4.Value,
        'Is Order Received': CheckboxCanvas1.Checked,
        Attributes: {Value: DropdownCanvas1.Selected.Value}
    }
)

Where,

  1. Attributes = SharePoint Choice Column Name
  2. DropdownCanvas1 = Power Apps Modern Dropdown Control Name
powerapps does not match the expected type record found type text
  • Once you apply the above code, you will no longer see the specific Patch function error. Just save and publish the app. Preview the app and click on the SUBMIT button. Finally, the value will be saved in the Power Apps Collection.
  • Additionally, in most cases, you might get the same error by using the SharePoint Currency Column, SharePoint Number Column, etc. To resolve this Patch error, you can use the code below:
For SharePoint Currency Column - Price: Value(Text(TextInputCanvas1_3.Value))
For SharePoint Number Column - Quantity: Value(Text(TextInputCanvas1_2.Value))

Where,

  1. Price = SharePoint Currency field name
  2. Quantity = SharePoint Number field name
  3. TextInputCanvas1_3, TextInputCanvas1_2 = Power Apps Modern Text input control names

This is how to resolve the Power Apps Patch error: The type of this argument ‘Attributes’ does not match the expected type ‘Record’. Found type ‘Text’. The function ‘Patch’ has some invalid arguments.

Moreover, you may like some more Power Apps and Dataverse tutorials:

This Power Apps Tutorial explains how to fix an error, i.e., “The type of this argument ‘Attributes’ does not match the expected type ‘Record’. Found type ‘Text’. The function ‘Patch’ has some invalid arguments” that comes while working with the Power Apps Patch function.

Power Apps functions free pdf

30 Power Apps Functions

This free guide walks you through the 30 most-used Power Apps functions with real business examples, exact syntax, and results you can see.

Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App