cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted

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

4 REPLIES 4
Highlighted
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.
Highlighted

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

Highlighted

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

Highlighted

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.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (10,106)