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 / Updating Second List f...
Power Apps
Answered

Updating Second List following edits of a form that is liked to a first list

(0) ShareShare
ReportReport
Posted on by 14

Hi, 

I have a project tracking MS List (Second list) that when an item is created it patches some columns to a Resource Tracker list (First list). When edits are made to the Project tracking list (Second list) I want to send those changes to the Resource Tracker list (First list) and update the record, without duplicating it. 


I have been following this thread but haven't been successful so far: Solved: When submitting a form trying to also patch on a d... - Power Platform Community (microsoft.com)

The fields in the second list that need to be sent to update the first list are, Shown below as (Second List: First List)
AA_ID: ID

FullName: DA Member,
Date_Start: Date_Start,
Date_End: Date_End,
Resource_Category: Resource_Category,
Modified: Modified,
Created: Created,
Modified By: Modified By,
Created By: Created By,

The ID field in the First list is used as the unique identifier to select the right record, therefore is the same as the AA_ID field in the Second list. 

 

Is someone able to me with the formula that should go into the form or button that is connected to the Second List?
Thanks in advance

Categories:
  • dprycePA Profile Picture
    14 on at

    The Code I have tried in the OnSuccess of the Second List is:
    With(Self.LastSubmit,
    Patch(
    'BC - Resource Tracker',
    {
    ID: LookUp('BC - Resource Tracker', AA_ID=ID, ID),
    FullName: ThisRecord.'DA Member',
    Date_Start: ThisRecord.Date_Start,
    Date_End: ThisRecord.Date_End,
    Resource_Category: ThisRecord.Resource_Category,
    Modified: ThisRecord.Modified,
    Created: ThisRecord.Created,
    'Modified By': ThisRecord.'Modified By',
    'Created By': ThisRecord.'Created By',
    AA_ID: ThisRecord.ID
    }
    )
    )

    The app doesnt like it and the error I get when i play the app and press button that submits the form states "Network error when using Patch function: The data returned by the service was invalid"

  • Verified answer
    WarrenBelz Profile Picture
    156,714 Most Valuable Professional on at

    Hi @dprycePA ,

    If you are updating an exiting record, it would be something like this - you cannot write to the ID or the Created/Modified columns

    With(
     {_Record: Self.LastSubmit},
     Patch(
     'BC - Resource Tracker',
     LookUp(
     'BC - Resource Tracker',
     AA_ID = _Record.ID
     ),
     {
     FullName: _Record.'DA Member',
     Date_Start: _Record.Date_Start,
     Date_End: _Record.Date_End,
     Resource_Category: _Record.Resource_Category
     }
     )
    )

    If you are writing a new record

    With(
     {_Record: Self.LastSubmit},
     Patch(
     'BC - Resource Tracker',
     Defaults('BC - Resource Tracker'),
     {
     FullName: _Record.'DA Member',
     Date_Start: _Record.Date_Start,
     Date_End: _Record.Date_End,
     Resource_Category: _Record.Resource_Category
     AA_ID: _Record.ID
     }
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • dprycePA Profile Picture
    14 on at

    Hi Warren, thanks for the reply. When inputting the formula into the OnSuccess part of my form I get these errors:

    dprycePA_0-1709200927591.png

    dprycePA_1-1709200972356.png

    The Columns that for the list I want to send to are as follows:

    dprycePA_2-1709201017511.png

     

  • WarrenBelz Profile Picture
    156,714 Most Valuable Professional on at

    Hi @dprycePA ,

    LookUp has a Capital U

  • dprycePA Profile Picture
    14 on at

    If I try to fix the LookUp function, by using First(Filter('BC - Resource Tracker', AA_ID = _Record.ID))
    I get the following error

    dprycePA_0-1709202984947.png

     

  • dprycePA Profile Picture
    14 on at

    Hi @WarrenBelz 
    Thanks for the spot !! I now get this error, even though we are patching through FullName, 

    dprycePA_3-1709204517860.png

    could it be because I have a lookup column that pulls through a column FullName: Email from another list as below?

    dprycePA_4-1709204525729.png

  • WarrenBelz Profile Picture
    156,714 Most Valuable Professional on at

    @dprycePA ,

    First(Filter( is just a long way of doing a LookUp, but the point is you have shown the AA_ID is a number field in 'BC - Resource Tracker', and clearly the last submitted record (which is referred to as _Record) has an ID field, so how can this not be valid ?

    LookUp(
     'BC - Resource Tracker',
     AA_ID = _Record.ID
    ),

    There is something not correct in the posted structure here I suspect.

  • WarrenBelz Profile Picture
    156,714 Most Valuable Professional on at

    @dprycePA ,

    To be honest, SharePoint lookup columns are not necessary generally and will cause you much unwanted complexity and restrictions with Power Apps. I have not and probably never will use them. It appears you have a compulsory field that may be causing all this issue

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard