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 / On each ForAll, Update...
Power Apps
Answered

On each ForAll, Update Collection with Custom Connector parameters

(0) ShareShare
ReportReport
Posted on by 14

Hi!  Hoping you can assist.

 

I have a custom API connector that is added to a collection passing a CompanyID parameter.  This is working perfectly.  What I'm trying to do is add the "CompanyID" parameter that is being passed to the "CompanyID" in the new "findings" collection as it iterates.  Here's the formula that I currently have.  I have hardcoded the 1, but need the correct CompanyID. Any thoughts?

 

ForAll(
clientlist,
Collect(
findings,
DataConnect.GetPGroups({CompanyID: Value(CompanyID)})
); UpdateIf(findings,IsEmpty(CompanyID) = true,{CompanyID: 1})

 

2021-05-23 13_16_27-Master Agent Tool - Saved (Unpublished) - Power Apps.png


)

 

 

Categories:
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @jdlevms Try this,

    ForAll(
    clientlist As myclientlist,
    Collect(
    findings,
    AddColumns(DataConnect.GetPGroups({CompanyID: Value(myclientlist.CompanyID)}), "CompanyID", CompanyID
    )

    Now the collection findings should have a column "CompanyID". Hope this helps! 

  • Verified answer
    jdlevms Profile Picture
    14 on at

    Thanks, @CNT.  That approach may have worked with some tweaking, but I was able to get it figured out.  I needed to update the UpdateIF to add the clientlist[@CompanyID] since companyID exist in both collections.  Here is the final code if anyone runs into the same challenge

     

    ForAll(clientlist,Collect(findings,DataConnect.GetPGroups({CompanyID:Value(CompanyID),Status:1}));
    UpdateIf(findings,IsBlank(CompanyID)=true,{CompanyID: clientlist[@CompanyID]}))

     

    2021-05-23 15_54_29-Master Agent Tool - Power Apps.png

     

     

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @jdlevms I new this situation where CompanyID exists in both places. That's why I had use the As quantifier, clientlist As myclientlist. Did you try that? Anyway, glad it works!

     

    Please remember to give a 👍 and accept the solution as it will help others in the future.

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard