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 / Problem with Patch in ...
Power Apps
Answered

Problem with Patch in OnSuccess of SP Custom Form

(0) ShareShare
ReportReport
Posted on by 25

Hi,

 

I am trying to use the Patch command to update the current record in the SharePointForm.OnSuccess action. If I do something like this : 

Patch(Expenses, SharePointForm1.LastSubmit,{
FullName:CurrentUser,
VAT:"TEST1",
Nominal: "TEST2"
});
ResetForm(SharePointForm1); 
RequestHide()

It works fine. However If I update the VAT, and Nominal fields to get values from a list box, such as :

Patch(Expenses, SharePointForm1.LastSubmit,{
FullName:CurrentUser,
VAT:ListBoxNominal.Selected.Vatcode,
Nominal: ListBoxNominal.Selected.Code
});
ResetForm(SharePointForm1); 
RequestHide()

This does not work and the VAT and Nominal fields are not updated. If I go back and edit the record and save it again, the values are then updated!?

 

I have also done a test and changed the OnSuccess to just output the results of the ListBoxNominal and it is outputting the expected value :

Notify("Result = " & ListBoxNominal.Selected.Code,NotificationType.Information);

Can someone help me to get the Patch statement working using the results from the selected item in the list box ?

 

Categories:
  • Verified answer
    Assurity Profile Picture
    25 on at

    Well after searching some more on these forums I found my answer :

     

    If I add the following line before the Patch command the update then works :

     

    Refresh(Expenses);

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard