cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tbabe
Helper II
Helper II

joining tables using collection and addcolumn

Hi, i am trying to join two tables from sql, and i want to be able to display records in the detail screen. How do i go about creating the collection and adding column. i have a screenshot below: where do i create the collections(on select , in my submit button where the search takes place? or on visible? i will like my column to display on the detail screen. 

4 REPLIES 4
RandyHayes
Super User
Super User

@Tbabe 

What is it that you are trying to create a collection for?  Can you provide more details on what it is used for?

Unless there is a particular need for another duplicate in memory database of your data, you can just put the formula you need in the place you are trying to provide data.

_____________________________________________________________________________________
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

ok,  what i am trying to do is to add another table to my datasource, how do i go about it? ClearCollect(Collection1,AddColumns(WorkOrders,"Jobs",LookUp(Jobs,"job_address1_Column1" = WorkOrders[@job_address1])))

RandyHayes
Super User
Super User

@Tbabe 

I'm going to need more information!  There are a hundred ways to go about it.  Are you trying to add columns to your existing table that have a table of other records, or a lookup of certain records related to one record, or are you trying to combine two tables of non-related records into one?

 

From the formula you provided, it appears that you want to perhaps create a column with related workorders.

I am not sure of the collection need, so the formula to have a column of related records from another datasource would be:

  AddColumns(WorkOrders As _item, "Jobs", LookUp(Jobs, job_address1_Column1 = _item.job_address1)

 

This is going to give you a table of the records in WorkOrders with a new column called Jobs that will have a table of the records from Jobs that relate to the address.

_____________________________________________________________________________________
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

yes, i am trying to add columns to an existing table(WorkOrder) from Jobs table, the tables are related by the (Job_address). 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,966)