Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

XML: related child record import?

Featured Replies

I need to understand how an xml file needs to be formatted so that when I do an xml data source import into Filemaker I can get multiple child records.

For example: the xml file contains people data (name, address etc) and it contains people's item data (spoon, fork, knife). The spoon, fork and knife data are 3 children records to the one "people" record.

This is the child section of the xml:

I know to first import into the parent table then switch to the child table and do another import. I know to use the parent key field in the second import so that the records keep their relationship to the parent.

What is happening is that I get only ONE child record when there are supposed to be multiple records imported.

Any help would be appreciated.

mark

Edited by Guest

Filemaker can export data from related tables, but it always imports into a single table only. The answer to the question "how does an xml file needs to be formatted" is "the same way it would have looked, had you exported from the child table". IOW, there must be a ROW element for each record - not just multiple DATA elements in a COL.

  • Author

THis is the xml that came OUT of FileMaker for one parent with 6 children. There is only one pair of ROW tags. If I import this I get just one of the child recs...:D

0

75594

DIGITAL D/C COUPLER DR-E4

DIGITAL A/C ADAPTER AC-E4

DIGITAL BATTERY CHARGER LC-E4

DIGITAL BATTERY PACK LP-E4

DIGITAL BATTERY PACK LP-E4

DIGITAL EOS-1Ds Mark III

Yes, that's how it looks when you export from the parent table. Now export from the child table, and see the difference.

  • Author

Yes, that's how it looks when you export from the parent table. Now export from the child table, and see the difference.

But what's your point? I'm trying to figure out the format I need "the web guys" on this project to give to me for data that has a parent table and 2 related child tables (that will contain multiple records related to each parent.

Are yoy saying that the format I provided here will NOT be importable into FMP in a way that will give me related child records?

Are yoy saying that the format I provided here will NOT be importable into FMP in a way that will give me related child records?

Not directly. The child records CAN be imported, IF there is a stylesheet transforming the imported document. The result of the transformation must look the same as an export directly from the child table would (Filemaker does the transformation during import, in a single step).

ADDENDUM:

To clarify: a single XML document cannot be imported into TWO tables without at least one stylesheet.

Edited by Guest

  • Author

Not directly. The child records CAN be imported, IF there is a stylesheet transforming the imported document. The result of the transformation must look the same as an export directly from the child table would (Filemaker does the transformation during import, in a single step).

ADDENDUM:

To clarify: a single XML document cannot be imported into TWO tables without at least one stylesheet.

Ok... it's still not clear to me.

I know I CAN import a single xml file into 2 tables by doing 2 imports WITHOUT a stylesheet.

What I don't know is what the xml file needs to look like to be able to get the multiple child records contained inthe xml file into multiple records in FMP.

Are you saying that the xml file FMP creates when exporting from the parent table and including child record data CANNOT be imported back into FMP into the parent (in 1 import) and the children (in a second import) without an XSLT transformation?

If this is the case I need someone to write an XSLT for me.... (for pay of course)

Anyone?

Edited by Guest

I know I CAN import a single xml file into 2 tables by doing 2 imports WITHOUT a stylesheet.

No - at least not correctly. In your example, there is a single parent record for each group of child records. When importing this into the child table, Filemaker creates one record for each record in the XML document - so it ends up importing one child per parent, exactly as you have observed.

Are you saying that the xml file FMP creates when exporting from the parent table and including child record data CANNOT be imported back into FMP into the parent (in 1 import) and the children (in a second import) without an XSLT transformation?

Yes.

If this is the case I need someone to write an XSLT for me

Contact me privately, if you wish.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.