web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / patch records on a lis...
Power Apps
Answered

patch records on a list column into another list

(0) ShareShare
ReportReport
Posted on by

I have 2 Lists (ListA and ListB) with same unique id EID. Now I want to compare ListA.EID and ListB.EID when its true patch all the data in field ListA.Status into ListB.Status. How do i do this?

I tried below but not working

Patch(ListB, LookUp(ListB, EID in ListA.EID), {Status : ListA.Status});

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Can you define the ListA.EID before?? That might be what is causing the error and you should use equals ( = ) instead of in

     

    Set(varEIDFromListA, CONDITION);

     

    Patch(ListB, LookUp(ListB, EID = varEIDFromListA), {Status : ListA.Status});

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,
    Gonçalo Nogueira

    Check my LinkedIn!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    @Nogueira1306 mentioned we need an equal sign and condition to update a single record.

     

    For multiple records, we may need to loop through

    ForAll(
     ListA As Source,
     With(
     {
     Item: LookUp(
     ListB,
     EID = Source.EID
     )
     },
     If(
     !IsBlank(Item),
     Patch(
     ListB,
     Item,
     {Status: Source.Status}
     )
     )
     )
    )

     

    Again, no records are based on the app settings limit.


    Thanks,
    Stalin - Learn To Illuminate

  • Community Power Platform Member Profile Picture
    on at

    ListA.EID is a field name not parameter.

    varEIDFromListA : No this is a field from another List

  • Community Power Platform Member Profile Picture
    on at

    The item still flagging error

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Item is just a temp variable. You can rename anything. Please share the error.

  • Community Power Platform Member Profile Picture
    on at

    The button faded and query was running forever and never patches. Both Lists has 250 records. 

     

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Anonymous 

    Doing this will incur issues with delegation to the datasource.  So if record amounts don't exceed record limits, then you can use the following formula:

    Patch(ListB,
     ForAll(Filter(ListB, EID in ListA.EID) As _item,
     With({_a: LookUp(ListA, ListA.EID = _item.EID)}
     Patch(_item, {Status: _a.Status})
     )
     )
    )

    This formula uses the ForAll properly (as a table producing function) and will not put your app into a "deadlock" trying to perform the operation.  It will still not be the most performant formula do to the amount of data actions it has to do.

    But, if delegation is not a concern, then it can be streamlined to be much quicker.

     

    I hope this is helpful for you.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard