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 / Update SP List with va...
Power Apps
Answered

Update SP List with values from same list using Patch

(0) ShareShare
ReportReport
Posted on by

nvpc_0-1692412359647.png

the patch is working but only updates yellow part from table a to the VACANCYID. How can I add the blue part from table b the VACANCYID also, i.e. IT0820230002.

 

ClearCollect(colTableA, Filter(TableA, Import = "Yes"));


ForAll(colTableA,
Patch(TableB ,LookUp(TableB, Available = "Yes"),
{ Title: colTableA[@PO].Value,
VacancyNumber: Concatenate(colTableA[@POSID], TableB.BillID), // this is not working, reason I don't know how to reference TableB fields

VacancyNumber: Concatenate(colTableA[@POSID], "test"), // works
Available: false
}

)
)

Categories:
  • hroudaadam Profile Picture
    22 on at

    Hi there!

    First of all - do not use Patch + ForAll -> you can Patch multiple records at once (see https://www.matthewdevaney.com/patch-multiple-records-in-power-apps-10x-faster/).

    Now to your problem... I am no sure I understand you data. However here's an solution that comes to my mind...

    // patching multiple records at once
    Patch( 
     TableB,
     // when patching multiple record you only need columns with changes and with unique key
     ShowColumns(
     // add new column calculated from current and related collections
     AddColumns(
     colTableB,
     "VACANCYID",
     Concatenate(
     LookUp(colTableA, PO = ThisRecord.PO).POSID,
     ThisRecord.BILLID
     )
     ),
     "ID",
     "VACANCYID"
     )
    )

     

  • nvpc Profile Picture
    on at

    Thank you for your reply, I've tried using your code and is not working.

    nvpc_0-1692481108014.png

    this first error (1st circle) says "A column name "VACANCYID" already exists, so I renamed it "VACANCYID1"

    I also change the PO (two other circles) to ID as PO is not unique. This cleared the errors and I was able to run but no results, see below

    nvpc_1-1692481506372.png

     

  • Verified answer
    nvpc Profile Picture
    on at

    I managed to get this to work using the ForAll see bellow;

    before running code

    nvpc_0-1692490342091.png

    after running code

    nvpc_1-1692490441464.png

    ClearCollect(colImportedRecords, Filter(tableA, import = 1000));
    ForAll(colImportedRecords,
    Patch(TableB ,LookUp(TableB, AVAILABLE = true),
    { PO: colImportedRecords[@PO],
    VACANCYID: Concatenate(colImportedRecords[@POSID], LookUp(TableB, ID = colImportedRecords[@ID]).BILLID),
    AVAILABLE: false
    }
    )
    )

     

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

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
timl Profile Picture

timl 122 Super User 2026 Season 2

Last 30 days Overall leaderboard