web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

patch

(0) ShareShare
ReportReport
Posted on by 297

Hi 

 

I have a list in my sharepoint called Test with a column called Num1

jsmith87_0-1687445559655.png

 

Id' like to patch a text input ( textinput1) to Num1 with the onselect of a button, could someone tell me what syntax should be 

 

Thanks in advance

Categories:
  • Cr1t Profile Picture
    555 on at

    @jsmith87 

    Please try this 

    Patch(
     Test, // SharePoint list name
     Defaults(Test), // New record
     { Num1: TextInput1.Text } // Column to update with the value from TextInput1
    )

    Let me know if this works,

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • jsmith87 Profile Picture
    297 on at

    Hi, 

     

    no that doesn't seem to work

  • Cr1t Profile Picture
    555 on at

    @jsmith87 

    Do you get any error message? 
    You will have to put that code to OnSelect Property of button. I have done the test on my end and it works.

    Cr1t_0-1687447373893.pngCr1t_1-1687447511157.png

     

  • jsmith87 Profile Picture
    297 on at

    Hi, doesn't seem to want to work, am i doing something wrong?

     

    jsmith87_0-1687449628619.png

     

  • Cr1t Profile Picture
    555 on at

    @jsmith87 
    The x mark on button, can you please share the error message ?

  • jsmith87 Profile Picture
    297 on at

    it says "invalid argument type (Boolean). expecting a record value instead 

  • Verified answer
    cdwhite Profile Picture
    1,069 Most Valuable Professional on at

    The formula in the image isn’t quite correct, the Default(Test needs a closing bracket. So you probably want something like:

     

    Patch(Test, Defaults(Test), {Num:TextInput1.Text}).

     

    That will only work for creating a new record if that’s the only mandatory field that needs a value. If there are others in your SharePoint list, ie Title, that’ll need to be populated in that Patch too

  • Cr1t Profile Picture
    555 on at

    @jsmith87 

    Please correct your formula , you have to close the brackets after defaults. 

     

    Patch(
     Test, 
     Defaults(Test), 
     { Num1: TextInput1.Text } 
    );
    Reset(TextInput1)

     

    Also, check if the column name in your sharepoint is Num1 and as @cdwhite informed if there are other fields like title you need to add those as well. 

    Let me know if this works,

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @jsmith87 ,

     

    You mentioned "expects a record value instead"

    What is the datatype of your column "Num1" ?

    Pretty sure its not Single Line of Text. Is it lookup?

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard