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

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard