cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
livingstonep
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
Eelman
Super User
Super User

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

@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
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (3,164)