Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

Import XML to file from container?


This topic is 2697 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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

Posted
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

Posted
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. 

Posted

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.

Posted
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.

This topic is 2697 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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