cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
simms7400
Level 8

How to combine two table (2 columns each) in Gallaery?

Hi Folks -

 

I have the following:

  • rdInvestments
    • InvestmendId
    • InvestmentAlias
  • rdDevice
    • Name
    • Alias

I need to combine the above into one gallery where I will display "Title" and "Subtitle".  I tried a collection with ShowColumns but can't get it to work.  Unless ShowColumn method with a collection isn't correct?

 

Thank you for any help you can offer!!

1 ACCEPTED SOLUTION

Accepted Solutions
simms7400
Level 8

Re: How to combine two table (2 columns each) in Gallaery?

@PaulD1 @v-yutliu-msft 

 

I arrived at this solution and it works - combining two different sources into 1 collection with 2 columns:

Clear(PFIPFDCombo);
Collect(
    PFIPFDCombo,
	ShowColumns(
		RenameColumns(rdDevice, "Name","DataElementName","Alias","DataElementAlias"),
	"DataElementName","DataElementAlias")
);
Collect(
    PFIPFDCombo,
	ShowColumns(
		RenameColumns(rdInvestments, "ProjectCode","DataElementName","ProjectAlias","DataElementAlias"),
	"DataElementName","DataElementAlias")
);

Thanks!

View solution in original post

11 REPLIES 11
simms7400
Level 8

Re: How to combine two table (2 columns each) in Gallaery?

BTW - all (4) columns are the same type (TEXT).

Super User
Super User

Re: How to combine two table (2 columns each) in Gallaery?

What links your tables together? Is the join rdInvestments.InvestmentAlias and rdDevice.Alias?

Is the join 1:1 (in which case ShoeColumn may be applicable) or might there be multiple devices for each investment (in which case you should look at nested galleries)?

simms7400
Level 8

Re: How to combine two table (2 columns each) in Gallaery?

@PaulD1 

 

So I have a gallery where I select a data element which then directs me to this new gallery I'm trying ot create.

This new gallery will display all children from the data element I selected on the first gallery.

 

The children, however, are coming from different SP Lists.

 

hier.jpg

Column B are the children to the data element I select in Gallery one.

 

The collection should be all elements from both sources and then when I get to this new gallery, I will filter on the previous gllaery selection to only show the children (as shown in the screen shot above).


Does that make sense?

 

Community Support Team
Community Support Team

Re: How to combine two table (2 columns each) in Gallaery?

Hi @simms7400 ,

Could you tell me the relationship of the two tables?

I assume that:  InvestmentAlias field and Alias field represt the same value.

So you want to get a table that has three fields: 

  • InvestmendId
  • Name
  • Alias

If so, I've made a similar test for your reference:

ClearCollect(test,AddColumns(
GroupBy(
Collect(rdInvestments,
RenameColumns(rdDevice,"Alias","InvestmentAlias")
), //save two table to the same collection
"InvestmentAlias","sum"
), //group according to its alias
"Subtitle",Concat(sum,InvestmendId),"Title",Concat(sum,Name)
) //get value from the data of sum table

 

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
simms7400
Level 8

Re: How to combine two table (2 columns each) in Gallaery?

No, they are different.

I need a table with just two columns based on the sources.

InvestmentAlias and Alias are both description fields but contain different values the same with InvestmentId and Name

I need to take the values from InvestmentId and Name and place into 1 column then take values from InvestmentAlias and Alias and place into another column. So the result table will be 2 columns and PFI and PFD data elements.
simms7400
Level 8

Re: How to combine two table (2 columns each) in Gallaery?

So essentially,...

 

Alias from the source rdDevice and InvestmentAlias from rdInvestments will be grouped into the collection as "Title" while Name from rdDevice and InvestmentId from rdInvestments will be grouped into the SAME collection as "Subtitle".


Does that make sense?

simms7400
Level 8

Re: How to combine two table (2 columns each) in Gallaery?

@v-yutliu-msft @PaulD1  tagging.

Super User
Super User

Re: How to combine two table (2 columns each) in Gallaery?

Take a look at this link: 

https://powerusers.microsoft.com/t5/General-Discussion/Solved-union-operator-or-function-to-append-o...

It sounds like you are trying to 'union' the two SharePoint lists into a single list. If that is the case, the method at the link might be what you need.

Community Support Team
Community Support Team

Re: How to combine two table (2 columns each) in Gallaery?

Hi @simms7400 ,

That will be more easier.

Try this formula:

ClearCollect(table1,RenameColumns(rdInvestments,"Title","InvestmentAlias","Subtitle","InvestmendId");
ClearCollect(table2,RenameColumns(rdDevice,"Title","Alias","Subtitle","Name");
Collect(table1,table2)

Then, table1 will be the table that you want.

 

 

Best regards,

Community Support Team _ Phoebe Liu

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

Helpful resources

Announcements
thirdimage

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

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

Top Solution Authors
Top Kudoed Authors
Users online (6,086)