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.

Import XML to file from container?

Featured Replies

Hi All, Happy Sunday!

 

I'm trying to build a layout that contains 5 containers so my employees can drag and drop XML files into each container and then I can run a script to export those XML files and import them into my filemaker database.

I'm struggling to get the data exported from the containers and imported back.

 

What is the best way to do this? Export container via $path then import $path file?

Thank you so much in advance.

That's the basic mechanism: export field contents to a known location (you set that, variable or otherwise), import from that same known location.

21 hours ago, wattmhite said:

I'm trying to build a layout that contains 5 containers so my employees can drag and drop XML files into each container and then I can run a script to export those XML files and import them into my filemaker database.

I'm struggling to get the data exported from the containers and imported back.

 

What is the best way to do this? Export container via $path then import $path file?

With FM 14 and up, I believe, there may be another way that does not involve a round trip to the filesystem.

Create a text field and use base 64 functions to get at the text from the file in the container field. You can test by setting the text field to with this:

Base64Decode ( Base64Encode ( your_containter_field ))

This should work if your text files in the containers are not text encoded that might throw this off.

Hope this helps,
Mike

7 minutes ago, Mike Duncan said:

use base 64 functions to get at the text from the file

Getting at the text in a file and importing it are two very different things. Especially if the "text" is XML. 

But it's still a valid approach.  Not everyone is good at writing an XSLT to import the XML; some prefer to use the FM text parsing functions to get through the XML.  I've done both, depending on the complexity of the XML document.

12 minutes ago, Wim Decorte said:

some prefer to use the FM text parsing functions to get through the XML

I strongly advise against that. In fact, strongly is not strong enough. XML cannot be parsed reliably as text.

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.