cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cyarbrough
Helper III
Helper III

Combine two columns from two different sources?

i'm going to start from the very beginning of what i'm doing, so if i'm making this way too complicated someone can tell me.

 

i'm making an app that's a directory of parts where i can also create bills of materials and view them. when viewing a BOM, i want to see a list of all the required parts and be able to click them to open the info for that particular part. i have the part directory finished and i know how to do the last bit with clicking through to part info, but i'm running into some problems displaying the bill of materials.

 

here's how i'm making and saving them:

 

 

f0.png

so the record looks like this in the BOM entity:

 

f1.png

 

here's where the problem comes in. when i view the BOM, i want to see the parts and their quantities in a gallery -- to do that, i need to split both of these strings and make them into a 2-column collection?

 

this is my onvisible for the BOM view page and the resulting collections:

f2.png

 

so, in theory, all i need to do is combine both of these collections into one 2-column collection, then put that into a gallery. i can't figure out how to do that without ending up with at least one column being a nested table. can someone help?

1 ACCEPTED SOLUTION

Accepted Solutions

Hello cyarbrough,

Maybe not the easiest way but until we find it you can use this:

ClearCollect(counter,0);
Clear(Combined);
ForAll(bomparts,
Collect(counter,Last(counter).Value+1);
Collect(Combined,{
bomparts:Last(FirstN(bomparts,Last(counter).Value)).Result,
bomquan:Last(FirstN(bomquan,Last(counter).Value)).Result
}))

View solution in original post

5 REPLIES 5
v-monli-msft
Community Support
Community Support

Hi @cyarbrough,

 

This means that you need to join columns from 2 data sources in one gallery, please take below thread as reference and see if this could help:

https://powerusers.microsoft.com/t5/General-Discussion/Can-I-add-fields-from-multiple-data-sources-i...

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello cyarbrough,

Maybe not the easiest way but until we find it you can use this:

ClearCollect(counter,0);
Clear(Combined);
ForAll(bomparts,
Collect(counter,Last(counter).Value+1);
Collect(Combined,{
bomparts:Last(FirstN(bomparts,Last(counter).Value)).Result,
bomquan:Last(FirstN(bomquan,Last(counter).Value)).Result
}))

thanks, mike8. i figured out how to get everything working how i wanted based on the formula you gave me.

Anonymous
Not applicable

Thank you. I have spent quite some time trying to figure out similar problem, and then your solution popped out working like a charm. Cheers.

Altino
Regular Visitor

Hello, does the funciton that a  colleague placed only return the last record in the table ? 

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,060)