cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Kudo Commander
Kudo Commander

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
Highlighted
Super User II
Super User II

@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
Highlighted
Super User II
Super User II

@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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,085)