cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Create a List out of 2 smaller ones

Here's the situation:

My app allows reading and writing on 2 different tables (both come from excel but one is Table_A and the other Table_B). These 2 tables have a common field as far as name is concerned: Serial_number. I'm looking to create a list of all the serial numbers of both these tables, list that could be used to select an item from it and do things with it.

Example: In the same list (let's call it List_C) I want to be able to either select item_from_table_A or item_from_table_B, the selection process being based on the common field: serial_number.

 

Is there any way of achieving this in Power Apps ?

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Anonymous 

You can collect both lists into one with a formula such as this:

ClearCollect(List_C, Table_A, Table_B)

If they both have the same columns, you will have one long list.

If they have dissimilar columns then you will have a collection with all items and all columns.

If serial_number is common in both list, then that column will be included and be populated from both sets of items.

If ALL you want is the serial_number columns, then you can use a formula such as this:

ClearCollect(List_C, ShowColumns(Table_A, "serial_number"), ShowColumns(Table_B, "serial_number"))

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

1 REPLY 1
RandyHayes
Super User
Super User

@Anonymous 

You can collect both lists into one with a formula such as this:

ClearCollect(List_C, Table_A, Table_B)

If they both have the same columns, you will have one long list.

If they have dissimilar columns then you will have a collection with all items and all columns.

If serial_number is common in both list, then that column will be included and be populated from both sets of items.

If ALL you want is the serial_number columns, then you can use a formula such as this:

ClearCollect(List_C, ShowColumns(Table_A, "serial_number"), ShowColumns(Table_B, "serial_number"))

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

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

Top Solution Authors
Top Kudoed Authors
Users online (1,229)