Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Collect with Split and forAll

(0) ShareShare
ReportReport
Posted on by 170

Hi, 

 

I have collection MainData with 4 fields:

Number - Expences - Sum - Counterparties

"1" - "expence1" - "200" - "Counterparty1; Counterparty2"

"2" - "expence2" - "300" - "Counterparty3"

 

I would like to create another collection of all counterparties

Counterparties

Counterparty1

Counterparty2

Counterparty3

 

How to get this collection?
I try something like this but it dont work:)

ForAll(MainData.CounterParties;
ForAll(Split(CounterParties;"; ") As _item;
Collect(CounterParties1;{CounterParty: _item}));;

  • CNT Profile Picture
    10,919 Super User 2025 Season 1 on at
    Re: Collect with Split and forAll

    @shnurich Glad it works!

     

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

  • CU09100753-0 Profile Picture
    170 on at
    Re: Collect with Split and forAll

    yes, thank u a lot, for me works this code:

    ForAll(MainData; Collect(CounterPartiesTab; Split(ThisRecord.CounterParties; ";")))

  • Verified answer
    CNT Profile Picture
    10,919 Super User 2025 Season 1 on at
    Re: Collect with Split and forAll

    @shnurich 

    It works as seen below,

     

    CNT_0-1623850614446.png

     

    Try this sample first and then adapt it to your needs,

    ClearCollect(MainData, {Number:1,Counterparties:"CP1; CP2"}, {Number:1,Counterparties:"CP3; CP4"});
    Clear(CounterParties);
    ForAll(MainData.Counterparties, Collect(CounterParties, Split(ThisRecord.Counterparties, ";")))

     

  • CU09100753-0 Profile Picture
    170 on at
    Re: Collect with Split and forAll

    some problem with Split function. 

    PowerApps cant see anything after ThisRecord.

     

    And How also collect CounterParties Collection with another empty string field:

    For example:

    CounterParty - Status - ID

  • CNT Profile Picture
    10,919 Super User 2025 Season 1 on at
    Re: Collect with Split and forAll

    @shnurich Try this,

    ForAll(MainData.Counterparties, Collect(CounterParties, Split(ThisRecord.Counterparties, ";")))

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard