cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Stoikryz
Frequent Visitor

Combining multiple collections into one for (potentially) view-only purposes

Hello!

 

I have 5 collections, some with different columns(Some columns will be going away, I'm still learning the best way to set these up). These 'line item' collections need to appear on one screen before they're fully Submitted to my datasource(Think a confirmation screen overview), and I was thinking if I could somehow combine them all, passing in null or blank values in the columns with no data.
They're designed to be relatively dynamic, and any of these collections could have no records.

colMaterials

IDDescMaterialIDQtyTempKeyTotalsUnitPriceUoM
        


colEquipment

IDDescEquipmentIDOtherQtyTotalsUnitPriceUoM
        

 

colLabor

IDDescrHoursLaborRateTotals
      

 

colMileage

IDDescMarkupMileageIDMileageRateMilesQtyUnitPriceUoMTotals
          

 

colOther

IDDescOther2Other3OtherIDQtyTotalsUnitPriceUoM
         


Currently, I have a Datatable with the following code, however if a collection happens to be empty (Say colLabor for instance), but colEquipment and colMileage both have data, then PowerApps inserts a blank record in between. I also have no 'logic' in editing records from this data table.

 

 

Ungroup(
    Table(
        {Items: colMaterials},
        {Items: colEquipment},
        {Items: colLabor},
        {Items: colMileage},
        {Items: colOther}
    ),
    "Items"
)

 


Does anybody have any ideas of where I could start looking? Thanks in advance!

 

Optional goal: ideally I would like either an editable grid situation where my users can make changes right from that page, or at least a way to link back to that specific record to edit it on the actual edit screen. (Each Collection has its own screen where users can add, remove, or edit records; the Confirmation screen is where the final "Submit" patch is performed)

1 ACCEPTED SOLUTION

Accepted Solutions
v-liwei-msft
Microsoft
Microsoft

Hi @Stoikryz ,

 

Could you please tell me: 

1.If you want to make collection not appear in the table when it is empty?

2.If collection colLabor is empty?

I suggest you use this formula:
Ungroup(
Filter(
Table(
{Items: colEquipment},
{Items: colLabor},
{Items: colMileage}
),
!IsEmpty(Items)
),
"Items"
)

 

Best Regards,

Levi

 

View solution in original post

1 REPLY 1
v-liwei-msft
Microsoft
Microsoft

Hi @Stoikryz ,

 

Could you please tell me: 

1.If you want to make collection not appear in the table when it is empty?

2.If collection colLabor is empty?

I suggest you use this formula:
Ungroup(
Filter(
Table(
{Items: colEquipment},
{Items: colLabor},
{Items: colMileage}
),
!IsEmpty(Items)
),
"Items"
)

 

Best Regards,

Levi

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,644)