wattmhite Posted August 27, 2017 Posted August 27, 2017 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.
Wim Decorte Posted August 28, 2017 Posted August 28, 2017 That's the basic mechanism: export field contents to a known location (you set that, variable or otherwise), import from that same known location.
Mike Duncan Posted August 28, 2017 Posted August 28, 2017 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
comment Posted August 28, 2017 Posted August 28, 2017 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.
Wim Decorte Posted August 28, 2017 Posted August 28, 2017 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.
comment Posted August 28, 2017 Posted August 28, 2017 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now