Export Record, Import Record?
Is there a way to do this? I want to split one table into two tables. I duplicated the table, exported the table, imported the table, but the only data transferred was that shown in the table view, which in my case is not all the data in the records.
12 replies
-
I think export/import is specific to the current table view, so you would have to first add the missing columns to your table view.
-
Why worry about the export / import .. etc.. Unless you do not want to "code".. Create Table 2 with the structure you want.. then create a temporary button action (really on ANY table. ) .. behind the button.. put a for loop that pulls the data from table 1 and pumps it to table 2..
-
Please explain how to write the "for loop," then I will give it a try. Thanks
-
I do not want to code. I looked at Andy's "for loop" video. My head is smoking! That is way beyond my skills.
-
Put a button on the Table1 form, with the following on click code.
let t := (select Table1);
let n := 0;
for i in t do
n := n + 1;
let p := (create Table2);
p.('Field 1' := i.'Field 1');
p.('Field 2' := i.'Field 2')
end
Be aware that "create Table2" adds a new record, not a new table. Also, add single quotes around any table name or field name that contains space(s).
-
Thanks Dean, that works great.
-
Is there a way to make this work on some of the records in the table? Seems that all the records get transferred to the other table.
-
What criteria do you want to use to select the records that will be copied to Table2?
-
I have a choice field, and in that field I want to choose "Televisions."
-
let t := (select ParentTableName where text(Choice) = "Televisions");
let n := 0;
for i in t do
n := n + 1;
let p := (create ChildTableName);
p.('Carrier Number' := i.'Carrier Number');
p.('Tracking Number' := i.'Tracking Number')
end
The above code assumes that the name of your choice field is "Choice" and that you want to copy over only the records that have "Televisions" selected in the choice field. Only the first line of the code was changed.
-
Nice. Thanks. I know nothing about coding, your (and others) help is much appreciated.
-
let s := "";
switch text(Choice) do
case "Televisions":
(s := "Televisions")
case "Radios":
(s := "Radios")
case "":
(s := "")
end;
let t := (select ParentTableName where text(Choice) = s);
let n := 0;
for i in t do
n := n + 1;
let p := (create ChildTableName);
p.('Carrier Number' := i.'Carrier Number');
p.('Tracking Number' := i.'Tracking Number')
end
Content aside
- 4 yrs agoLast active
- 12Replies
- 1577Views