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 / Problems combining two...
Power Apps
Unanswered

Problems combining two collections

(1) ShareShare
ReportReport
Posted on by 8
I have the following collections
 
ClearCollect(
  colActualEventCount,
    ShowColumns(
       Filter(
         Jobs, StartDate >= dp_SearchStartDate && StartDate <= dp_SearchEndDate.SelectedDate
     ),
     Job_Id,
     Band_Id_fk,
     EventName,
     JobClassification_Id_fk,
     StartDate, 
     Status_Id_fk
   )
);
 
ClearCollect(
  colCeremonialBandUnitEvents,
    ShowColumns(
      Filter(UnitsToJobs, Value(dd_BandSelection.Selected.Band_Id) = Value(Band_Id_fk)
      && Unit_Id_fk = 149)
    ),
    Job_Id_fk,
    Band_Id_fk,
    Unit_Id_fk,
    UnitCode
);
 
The colActualEventCount has a one to many relationship with the colCeremonialBandUnitEvents collection.
 
How do I create the query that would perform an join of the colActualEventCount and the colCeremonialBandUnitEvents based on Job_Id = Job_Id_fk and return the columns Job_Id, Unit_Id, EventName, StartDate, JobClassification_Id_fk and Unit_Id_fk and UnitCode? 
 
Also, where can you recommend go place to learn about how to develop queries for Power Apps?
Categories:
I have the same question (0)
  • StretchFredrik Profile Picture
    3,395 Super User 2025 Season 2 on at
    Hello,
     
    Not sure if this is what you are looking for, but give it a shot and get back to me if there is anything you would like to do differently or if delegation warning is a problem with your datesources. 
     
    ClearCollect(
        colJoinedEvents,
        ForAll(
            colActualEventCount As currentActualEvent,
            ForAll(
                Filter(colCeremonialBandUnitEvents, Job_Id_fk = currentActualEvent.Job_Id) As unit,
                {
                    Job_Id: currentActualEvent.Job_Id,
                    EventName: currentActualEvent.EventName,
                    StartDate: currentActualEvent.StartDate,
                    JobClassification_Id_fk: currentActualEvent.JobClassification_Id_fk,
                    Unit_Id: unit.Unit_Id_fk,
                    UnitCode: unit.UnitCode
                }
            )
        )
    );
    
    If my response solved your issue, please mark it as ✅ Accepted Answer and give it a like.
  • Verified answer
    WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at
    Offering another structure that may be also useful.
    ClearCollect(
       colCombined
       RenameColumns(
          AddColumns(
             colCeremonialBandUnitEvents,
             EventName,
             LookUp(
                colActualEventCount As _Data,
                _Data.Job_Id_fk = Job_Id
             ).EventName,
             JobClassification_Id_fk,
             LookUp(
                colActualEventCount As _Data,
                _Data.Job_Id_fk = Job_Id
             ).JobClassification_Id_fk,
             StartDate,
             LookUp(
                colActualEventCount As _Data,
                _Data.Job_Id_fk = Job_Id
             ).StartDate,
             Status_Id_fk,
             UnitCode,
             LookUp(
                colActualEventCount As _Data,
                _Data.Job_Id_fk = Job_Id
             ).UnitCode
          ),
          Job_Id_fk,
          Job_ID,
          Unit_Id_fk,
          Unit_ID
       )
    )
    ​​​​​​
  • Community member Profile Picture
    8 on at
    The second posted answer returns a table with the one column titled Value with each row having an entry of [Table].
     
    It seems like it should be simple to combine two tables like in a simple SQL join.

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