cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
livingstonep
Kudo Kingpin
Kudo Kingpin

Patch() function error - expected type: Text, found Record

I am trying to patch a column in the SharePoint List in my PowerApps form.

 

The SP list is called 'Create Expense Claim'

 

The column, which is defined as a Single line of Text is called AP_CheckerName

 

The currect record being edited is defined by editRecord.

 

I want to patch the column AP_CheckerName with the current User full name so I tried this:

   Patch(
        'Create Expense Claim',
        editRecord,
        {
            AP_CheckerName: {
                ID: editRecord.ID,
                Value: Text(User().FullName)
            }
        }
    );

 

but I get an error The type of this argument 'AP_CheckName' does not match the expected type 'text'. Found type 'Record'

 

how do I fix that?

1 ACCEPTED SOLUTION

Accepted Solutions
Eelman
Community Champion
Community Champion

@livingstonep 

Try this:

Patch(
        'Create Expense Claim',
        editRecord,
        {
            AP_CheckerName: Text(User().FullName)
            }
    );

And you are trying to send a record to a text field. Think of the { ..}'s as a record so your code reads:

 

Patch( ... , ... , { <-- start of record 1 AP_CheckerName: { <-- start of record 2 ... end of record 2 --> } ... end of record 1 --> }

 

So, you are attempting to add a record to a text field, if that makes sense?

 

 

View solution in original post

1 REPLY 1
Eelman
Community Champion
Community Champion

@livingstonep 

Try this:

Patch(
        'Create Expense Claim',
        editRecord,
        {
            AP_CheckerName: Text(User().FullName)
            }
    );

And you are trying to send a record to a text field. Think of the { ..}'s as a record so your code reads:

 

Patch( ... , ... , { <-- start of record 1 AP_CheckerName: { <-- start of record 2 ... end of record 2 --> } ... end of record 1 --> }

 

So, you are attempting to add a record to a text field, if that makes sense?

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,183)