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 Apps
Unanswered

Patch and Array

(0) ShareShare
ReportReport
Posted on by 170

Hi!

 

I have a collection MainData3 with 4 fields: CounterParties, Expenses, Sum, Number

shnurich_0-1625476242654.png

And CounterParties its an array:

shnurich_1-1625476284287.png

I create a gallery for MainData3 and a second gallery2 into for ThisItem.CounterParties.

 

I would like to add and delete into one item some counterParties
And try it, but it just update one Counterparty.
Patch(MainData3;LookUp(MainData3;Expence=ThisItem.Expence);{CounterParties: {Name: ComboBox9.Selected.CounterPartyName}})

How to add new CounterParty to CounterParties Array correctly and how delete separatly from this Array?

 

Categories:
I have the same question (0)
  • CU09100753-0 Profile Picture
    170 on at

    Guys, please help:)

     

  • camchiltonVA Profile Picture
    6 on at

    Hi all, I just encountered the same issue as described above. I'm attempting to build a new json object with updated properties to be saved to a sharepoint list. I'm defining a new object to add to an existing collection:

    // add CDE-id module to jsonAccessConfig field
    Set(newCDEmodule,
     {
     id:"CDEID",
     roles:["EDITOR"],
     portfolios:[],
     providers:[],
     reasonForAccess:"test",
     approvalStatus:"APPROVED"
     }
    );
    
    Clear(collFinalCDEmodules);
    // convert new record to a table
    ClearCollect(collFinalCDEmodules, newCDEmodule);
    // trying to get values of roles array
    Set(rolesArray, collFinalCDEmodules.roles);
    
    ForAll(
     collFinalCDEmodules,
     Patch(
     collUserJsonModules,
     Defaults(collUserJsonModules),
     {
     id: collFinalCDEmodules[@id],
     //roles: collFinalCDEmodules[@id], // this line is the issue, what is the syntax to Patch an array here?
     approvalStatus: collFinalCDEmodules[@approvalStatus],
     reasonForAccess: collFinalCDEmodules[@reasonForAccess]
     }
     )
    );

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard