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 Pages / Patch - Patching the c...
Power Pages
Answered

Patch - Patching the current date to a Sharepoint List on Submit

(0) ShareShare
ReportReport
Posted on by 50

Hi,

 

I have two lists, a "Notes" list and a "Customer" list. I am trying to update a field in the Customer list (called "Date Last Contacted") based on the date a new note is added in the "Notes" list. Both lists have a customer identifier (Account Ref).

 

I am fairly new to PowerApps and so am assuming that Patch is the correct method for doing this?

 

If so, the patch statement I have so far is as follows:

 

Patch(Customer, LookUp(Customer, Gallery6.Selected.'Account Reference' in Customer.'Account Reference'), {Date_x0020_last_x0020_contacted: Today())}

 

This doesnt seem to show any errors but neither does it put today's date in the relevant Customer record.

 

Any help would be greately apprecaited.

 

James

Categories:
I have the same question (0)
  • Edwin-Abdalian Profile Picture
    641 on at

    --Edited ----

    Forms in Canvas Apps have a property called LastSubmit. On your Notes form, and on its OnSuccess Property, use your Patch:

    OnSuccess: Patch(Customer, Lookup('Customer', 'Account Reference' = NotesForm.LastSubmit.'Account Reference'), {Date_x0020_last_x0020_contacted: Today()}

    **Replace NotesForm with your form name.

    --------------------------------------------------------------------

    If this post helps, please choose Accept As Solution to help the other members, and give my post a Thumbs Up.

  • jamesbetteridge Profile Picture
    50 on at

    Thanks for your reply Edwin but I am still missing something. It's almost certainly me just not quite grasping Patch properly.

     

    I've got the following code now in the OnSuccess property of the form (called 'Form-Notes'):

     

    Patch('Customer Record', Title = 'Form-Notes'.LastSubmit.'Sage Reference', {Date_x0020_of_x0020_Last_x0020_C: Today()})

     

    So "Customer Record" is my sharepoint list. "Title" is the original field name but was renamed to "Sage Ref" (i've tried both but without success :-S). 'Form-Notes' is the form I am adding this patch statement to and "Sage Reference" is what the auto complete suggested I use however, the account reference is in DataCardValue92(Text Input) of Sage Reference_DataCard5(DataCard).  Date_x0020_of_x0020_Last_x0020_C is the field name in the Customer Record sharepoint list although it shows a more friendly name of "Date of Last Call".

     

    When I hover my mouse over the code is just says "The function Patch has some invalid arguments" or "Name isnt valid. The identifier isnt recognised" (This last error only shows when I hover over the word"Title" but doesnt alter if change "Title" to the current field name of "Sage Ref")

     

    Can you see where I am going wrong?

  • Edwin-Abdalian Profile Picture
    641 on at

    do you use SubmitForm(Form-Notes) to insert/edit records to your Notes List? did you check that your Note list gets populated with the correct data?

  • jamesbetteridge Profile Picture
    50 on at

    Yeah, i'm using SubmitForm(Form-Notes) and the Form-notes list is getting updated. Only it that isnt working is the Patch of the current date into the 'Customer Record' sharepoint list.

  • Verified answer
    Edwin-Abdalian Profile Picture
    641 on at

    Then try this:

    Patch('Customer Record', Lookup('Customer Record',Title = 'Form-Notes'.LastSubmit.'Sage Reference'), {Date_x0020_of_x0020_Last_x0020_C: Today()})

  • jamesbetteridge Profile Picture
    50 on at

    Edwin, you are an absolute superstar! That's nailed it, thank  you so much for your help and your super quick replies.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
rezarizvii Profile Picture

rezarizvii 71

#2
DP_Prabh Profile Picture

DP_Prabh 36

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 32 Most Valuable Professional

Last 30 days Overall leaderboard