Is there a way to append table2 to table3 (table2 and table3 have the same structure) when adding a row to table1? Additionally, copy the key of table1 in all rows of table2 before appending it to table3.
Example: when adding a customer to table1, also add a list of questions for the new customer with the key of the new customer to a separate table (table3). Table 2 is a template listing all the questions associated to a new customer.
Solved! Go to Solution.
OK here is what you can do.
I just got this working on my app
Step 1
Add a column (Lets say Column name โCopyKEYโ) to to Table 2 to and enter the same unique value in all the rows
This enable you to use a select statement to get all the rows of table two
Step 2
Add an action to Table2 Called โCopy This Row to Table 3โ
Do This = "Data: add a new row to another table use values from this row
Set the columns
Table3 <โTable2
Column Name = [Column Name]
etcโฆ
You said all the column names are the same
Step 3
Lets assume you key column for table 2 is QuestionID (this is important)
Then back at Table1 Create a new action โInitial Copyโ
Do this: Data Execute and Action on a set of rows
Referenced table : Table2
Referenced Rows = Select(table2[QuestionID], [CopyKey] = โThe value of CopyKeyโ)
Referenced Action = โCopy This Row to Table 3โ
Now when you select initiate copy From Table one it will run the select query and receive list of every row from Table 2 and telling every row in to create a copy of itself to table three
There is probably a way to get the New UserID into Table2 first in bulk but hat is beyond what I did in my app
Anyway hope that helps!
Is Table 2 just a Single Row of questions?
No it has about 20 rows. Each row is a question.
OK here is what you can do.
I just got this working on my app
Step 1
Add a column (Lets say Column name โCopyKEYโ) to to Table 2 to and enter the same unique value in all the rows
This enable you to use a select statement to get all the rows of table two
Step 2
Add an action to Table2 Called โCopy This Row to Table 3โ
Do This = "Data: add a new row to another table use values from this row
Set the columns
Table3 <โTable2
Column Name = [Column Name]
etcโฆ
You said all the column names are the same
Step 3
Lets assume you key column for table 2 is QuestionID (this is important)
Then back at Table1 Create a new action โInitial Copyโ
Do this: Data Execute and Action on a set of rows
Referenced table : Table2
Referenced Rows = Select(table2[QuestionID], [CopyKey] = โThe value of CopyKeyโ)
Referenced Action = โCopy This Row to Table 3โ
Now when you select initiate copy From Table one it will run the select query and receive list of every row from Table 2 and telling every row in to create a copy of itself to table three
There is probably a way to get the New UserID into Table2 first in bulk but hat is beyond what I did in my app
Anyway hope that helps!
Clean, simple and it works! Thank you very much!
No problem Happy to help. I just started myself and this community has been vital for me getting my own stuff working.
User | Count |
---|---|
44 | |
29 | |
22 | |
20 | |
14 |