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

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard