cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cyarbrough
Level: Powered On

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
Mike8
Level 10

Re: Combine two columns from two different sources?

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
Community Support Team
Community Support Team

Re: Combine two columns from two different sources?

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.
Mike8
Level 10

Re: Combine two columns from two different sources?

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

cyarbrough
Level: Powered On

Re: Combine two columns from two different sources?

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

newpeter0
Level: Powered On

Re: Combine two columns from two different sources?

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
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,286)