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 / Collect with Split and...
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}));;

Categories:
I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @shnurich Try this,

    ForAll(MainData.Counterparties, Collect(CounterParties, Split(ThisRecord.Counterparties, ";")))
  • CU09100753-0 Profile Picture
    170 on at

    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

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

    @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

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

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

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

    @shnurich 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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

#2
11manish Profile Picture

11manish 193

#3
Valantis Profile Picture

Valantis 138

Last 30 days Overall leaderboard