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 / Patch and Submit on th...
Power Apps
Answered

Patch and Submit on the same button.

(1) ShareShare
ReportReport
Posted on by 111
Hello I am running to an issue, please help
I am trying to achieve 
a. User opens a item from a gallery which opens the form in Edit Mode.
b. If they edit the form with new data, i want to only submit the form with the updated data.
c. I have a TextInputCanvas where user can add comment, i want this comment to be patched to Remarks Column and Submit the form.
d. If user edit the item and put comment in TextInputCanvas, I want it to patch the Remarks columns and submit the form.
 
Formula I have Onselect property of Save Button.
If(
    !IsBlank(TextInputCanvas1.Value),
    Patch(
        'Sales',
        itemID,
        {Remarks: User().FullName & " -" & TextInputCanvas1.Value & " " & itemID.Remarks}
    );
    SubmitForm(Form2_3),
    SubmitForm(Form2_3)
);
While I do this, even when user put data in TextInputCanvas1, the remarks column is not getting patched, it only submits the form. Can you please help and let me know what can I do here ?
 
Thank you.
Categories:
I have the same question (0)
  • ronaldwalcott Profile Picture
    3,908 Moderator on at
    How many different tables are you updating?
    If all the fields are in the same table in one form control then SubmitForm should update the values. Isn't this working?
  • Suggested answer
    jpespena Profile Picture
    335 on at
    Hi @mssa12345
     
    Assuming that TextInputCanvas1 control is a text input control, try using TextInputCanvas.Text to reference the input value of the control. Your code would look like this:
    If(
        !IsBlank(TextInputCanvas1.Text),
        Patch(
            'Sales',
            itemID,
            {Remarks: User().FullName & " -" & TextInputCanvas1.Text & " " & itemID.Remarks}
        );
        SubmitForm(Form2_3),
        SubmitForm(Form2_3)
    );
     Also for the Patch function, try changing the second part to LookUp('Sales', ID = itemID.ID).
     
  • mssa12345 Profile Picture
    111 on at
    Hi jpespena ,
    Yes TextInputCanvas1 control is a text input control (Preview Version), TextInputCanvas.Text is not a option it shows error in formula so using TextInputCanvas.Value. Also I tried using ID = itemID.ID for the patch function neither seem to work.
  • mssa12345 Profile Picture
    111 on at
    Yes its all one form, but I need to patch data the Remarks column and SubmitForm is not doing that.
     
    Thanks
  • Suggested answer
    ronaldwalcott Profile Picture
    3,908 Moderator on at
    Do something like this where LastSubmit will retrieve the last record which was updated. I am not sure when your canvas is cleared so can try creating a variable when it has a value.
     
    SubmitForm(Form1);
     
    UpdateContext({newSalary : LookUp('Job Descriptions', 'Job Title' = Form1.LastSubmit.'Job Title').Salary + 100 });
    Patch('Job Descriptions', LookUp('Job Descriptions', 'Job Title' = Form1.LastSubmit.'Job Title'), {Salary: newSalary});
     
    This lets you submit the form first then update the values. You can also run the patch in the OnSuccess instead of the OnSubmit.
  • Verified answer
    timl Profile Picture
    37,283 Super User 2026 Season 2 on at
    Hi  mssa12345
     
    If both Form2_3 and Patch are updating the 'Sales' data source, the probable cause of this issue is that because you're calling Patch followed by SubmitForm, the call to SubmitForm is overwriting the update that you made through Patch.
     
    I assume that TextInputCanvas1 is a control in Form2_3, meaning that it'll be cleared following a call to SubmitForm. What I would suggest in this case is to amend the call to your save button like so:
     
    Set(varTextInputCanvasValue, TextInputCanvas1.Value);
    SubmitForm(Form2_3)

    Then in the OnSuccess property of Form2_3, you would add the following formula:
     
    If(
        !IsBlank(varTextInputCanvasValue),
        Patch(
            'Sales',
            Form2_3.LastSubmit,
            {Remarks: User().FullName & " -" & varTextInputCanvasValue & " " & Form2_3.LastSubmit.Remarks}
        )
    )
    
     

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
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#2
11manish Profile Picture

11manish 205 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard