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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (47,357)