AnsweredAssumed Answered

Export related records including main table fields

Question asked by PieroF on Oct 14, 2014
Latest reply on Oct 14, 2014 by PieroF

Title

Export related records including main table fields

Post

Hello, I’d like to know if there is a way in FileMaker Pro 13 (running on MacOS 10.9.5) to export a set of related records that include fields from the main table.

Let me try to explain with a simple example.

a) Table1 with 2 fields and 2 records:

- field1: A, field2: H

- field1: B, field2: L

b) Table2 with 2 fields and 5 records:

- field3: H, field4: X

- field3: H, field4: Y

- field3: H, field4: Z

- field3: L, field4: S

- field3: L, field4: T

c) a relation between the 2 tables

Table1::field2 = Table2::field3

When I File/Export Records from Table1 in the Export fields dialog I define:

- Field1

- Table2::Field4

This is what I get: 5 records (plus their headings), one for each of the related records as expected:

- A, X

- <empty>, Y

- <empty>, Z

- B, S

- <empty>, T

where however only the first record of each group has values in the fields of the main table (Field1 in the example), while all records have values in fields of the related records.

Instead this is what I expected - i.e. the same 5 records where however Field1 is filled with its repeated value:

- A, X

- A, Y

- A, Z

- B, S

- B, T

This is what I actually need: creating a new Table based on this relation.

The above example is made up just to explain my question, and I know in this specific case reverting the tables in the export operation would solve the problem…

But my real life problem is more complex: the table is just one, the relation is a self relation on Field2, and the main point is that the table is large: roughly 80.000 records, so the self related records to be exported are on the order of magnitude of millions.

Since so far I could not find a way to get an exported set where all required fields are filled up, at the moment, after the exported set is created, I’m using a simple script looping on all exported records and filling up their missing values. This script was very easily coded, but its running time is comparable with the previous export time: if exporting did the full job I could save half of the time in these operations; hours in case of the 80.000 records.

Is there a way to get what I'm looking for ?

Thanks a lot for your help

Piero

Outcomes