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 / power apps: patch is n...
Power Apps
Unanswered

power apps: patch is not adding new record in sharepoint

(0) ShareShare
ReportReport
Posted on by 56

Hi All,

 

i have one app which is connected to 2 sharepoint list, one has data and one is empty.

i create one form to update first sharepoint list

it works perfectly and is updating records in first sharepoint list

Now i want to put those edited record in second sharepoint

like whenever i update in first and it will be added  as records in second sharepoint list.

 

here is my powerapps code that i put in submit button"

UpdateContext({varupdatedby:User().Email});UpdateContext({varupdateddatetime:Now()});

Patch(
 'MappingUI-UpdateMapPlanParent', 
 Defaults('MappingUI-UpdateMapPlanParent'),
 {Title:DataCardValue58.Text,
 PlanCodeExt:DataCardValue59.Text,
 PlanNameExt:DataCardValue67.Text,
 PayerCodeExt:DataCardValue68.Text,
 PayerNameExt:DataCardValue69.Text,
 ARGroup:DataCardValue71.Text,
 FinancialClassNameExt:DataCardValue70.Text,
 UpdatedBy:varupdatedby,
 UpdateDate:varupdateddatetime} );

 SubmitForm(Form6_6)&&(Notify("New Mapping is succesfully updated",NotificationType.Success,2000))&& Navigate(MapInsuranceMain); 

here is my sharepoint list details:

 

JitenderSinghEH_0-1656330410298.png

 

 

any advice, suggestion will be helpful

Thanks

Categories:
  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    Use the LastSubmitted function when you update a record in first SharePoint list to patch to the second SharePoint list. 

     

    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

    LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
    Subscribe to my YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg

  • JitenderSinghEH Profile Picture
    56 on at

    sorry i am new to this, can you please elaborate a little, thanks

  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    Please take a look at this: https://www.spguides.com/powerapps-lastsubmit/

    Your first patch, is patching to the 1st sharepoint list. Add another patch to add the item to the second list and use the Last Submit function in order to get the record.

     

    Alternatively create a Power Automate flow that everytime an item is modified in list 1 then the item is added in list 2. 

  • JitenderSinghEH Profile Picture
    56 on at

    'MappingUI-UpdateMapPlanParent' this is my second list, the first is only for updation so the submitform(for6_6) is updating in first sharepoint list

    but patch is not working in the second even if i run patch solo.

  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    Show me the code please for patching the second list?

     

  • JitenderSinghEH Profile Picture
    56 on at

    the patch statement  i am using is for second sharepoint list only? submitform i am using to update first one.

     

    i aplogize if i am not making myself clear

  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    I would like you to test something.

    Do your submit form first then apply the following for Patch:
    Patch('MappingUI-UpdateMapPlanParent',  LastSubmit(Form6_6), {In here add your fields for example: PlanCodeExt: Form6_6.LastSubmit.PlanCodeExt})

    Does that add anything to your second SharePoint List?

    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

  • JitenderSinghEH Profile Picture
    56 on at

    lastsubmit(form6_6) is an unknown and unsupported function

    error i got while doing that

  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    Change that for Form6_6.LastSubmit

  • JitenderSinghEH Profile Picture
    56 on at

    i am not getting the old error but i got new one

    ETAG mismatch (Conflicts exist with changes on the server, please reload

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 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard