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 Platform Community / Forums / Power Apps / Following tutorials bu...
Power Apps
Answered

Following tutorials but code has changed so form shows so many errors, i need help

(0) ShareShare
ReportReport
Posted on by 49

I have been learning Power Apps and following some videos YouTube but it seems the code has changed because i cannot recreate their results.

I have a list on SharePoint, i then created an app linked to it in power apps as a gallery, i got the data inputting into text boxes from the list, i then added an edit icon and set it so when the edit icon is clicked it will edit that record using the ID, that all works fine but when i add a save icon i start to get invalid arguments.

 

Code for edit

 

If(ThisItem.ID=EditMode,false,true)

 

 

Code for Text boxes (DisplayMode)

 

If(ThisItem.ID=EditMode,DisplayMode.Edit,DisplayMode.View)

 

 

Code for Save 

 

UpdateContext({EditMode: ""}); Patch('Petty Cash Reimbursement',{ID=ThisItem.ID},{Description:In_Desc.Text,Students:In_Stu.Number,Staff:In_Staff.Number,'Cost Per Head': In_Cost.Number,Value:In_Val.Number,'Claimant Signature':In_C_Sign.Text,'Manager Signature':In_M_Sign.Text,Code:In_Code.Number})

 

 

As soon as i enter the code for Save the formulas error out saying Invalid argument type with the text inputs and Unexpected characters we expect an operator such as +,*'or & at this point in the formula.

 

thanks for your help... Power Apps Newbie

Categories:
I have the same question (0)
  • mahoneypat Profile Picture
    1,720 on at

    Please try it with this small change in your Patch - {ID: ThisItem.ID}

     

    UpdateContext({EditMode: ""}); Patch('Petty Cash Reimbursement',{ID: ThisItem.ID},{Description:In_Desc.Text,Students:In_Stu.Number,Staff:In_Staff.Number,'Cost Per Head': In_Cost.Number,Value:In_Val.Number,'Claimant Signature':In_C_Sign.Text,'Manager Signature':In_M_Sign.Text,Code:In_Code.Number})

     

    Regards,

    Pat

  • Mpowis Profile Picture
    49 on at

    @mahoneypat sorry that change didn't work still as many errors

  • timl Profile Picture
    37,210 Super User 2026 Season 1 on at

    @Mpowis 

    Assuming that the save button should update the current record in the gallery, this is the formula that you should use.

    Patch('Petty Cash Reimbursement',
     LookUp(ID=ThisItem.ID), 
     {Description:In_Desc.Text,Students:In_Stu.Text,
     Staff:In_Staff.Text,'Cost Per Head': In_Cost.Text,
     Value:In_Val.Text,'Claimant Signature':In_C_Sign.Text,
     'Manager Signature':In_M_Sign.Text, Code:In_Code.Text}
    )

    The patch function takes three arguments - the data source, the record to update, and the record details.

    To specify the record that you want to update, we would call the lookup function.


    Also, assuming that the controls that you specify such as In_Stu are text input controls, there is no such property as Number. If you want to retrieve a numeric value, you would need to refer to the value function: eg, Value(In_Stu.Text)

  • Verified answer
    Mpowis Profile Picture
    49 on at

    You were so close, after more research and looking at your answer i tried the code many different ways and the one that finally worked was this:

     

    pdateContext(Patch('Petty Cash Reimbursement',ThisItem,{Description:In_Desc.Text,Students:Value(In_Stu.Text),Staff:Value(In_Staff.Text),Value:Value(In_Val.Text),'Claimant Signature':In_C_Sign.Text,'Manager Signature':In_M_Sign.Text,Code:Value(In_Code.Text)}))

    It may not be pretty but it works lol

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 426

#2
WarrenBelz Profile Picture

WarrenBelz 381 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 315 Super User 2026 Season 1

Last 30 days Overall leaderboard