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 via HTTP From Filemaker to FileMaker

Featured Replies

I need to pull data from my FMServer to a FMSolution. Since FileMaker cripples importing from any FileMaker sources I figured I could use XML via HTTP.

I have a local file and table and a clone of the same file and table on the server. All security is set.

I can use safari to browse to the url of...

"http://192.168.1.1/fmi/xml/FMPXMLRESULT.xml?-db=timeattend.fp7&-lay=xml&-findall"

The result all looks XMLish to me.

However.....

I made a script with the step of:

Import Records [http://192.168.1.1/fmi/xml/FMPXMLRESULT.xml?-db=timeattend.fp7&-lay=xml&-findall]

But when I go to specify import order, I get

XML parsing error:

expected end of tag 'meta'

Line Number: 6

Column Number: 3

Shouldn't this work without XSL?

Edited by Guest

Can you post the "XMLish" XML?

  • Author

<?xml version="1.0" encoding="UTF-8" standalone="no"?>008/11/2010382909:00:0011:00:0012:00:0014:00:0017:00:0008/11/201034607:00:0012:00:0013:00:0008/02/201034809:02:0012:00:0013:02:0016:58:00

Edited by Guest

  • Author

XML Sample was cut and pasted from Safari "View Source"

Here it is pretty like...

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

0

08/11/2010

3

829

09:00:00

11:00:00

12:00:00

14:00:00

17:00:00

08/11/2010

3

46

07:00:00

12:00:00

13:00:00

08/02/2010

3

48

09:02:00

12:00:00

13:02:00

16:58:00

Edited by Guest

The forum software doesn't like XML - it's best to zip a file and attach it.

Anyway, it seems like a valid FMPXMLRESULT document and you shouldn't need a stylesheet to import it (you can test this by saving it as a file and trying to import that).

  • Author

Saving the data from safari and importing it into FileMaker worked like a charm.

I tried recreating the script (just in case I corrupted it) still gives the meta error

Argh... Frustrating!

  • Author

Can you try this with your own databases?

I have a few suspects, but not enough info:

1. Is it always EXACTLY the same error message?

2. Try putting the saved file somewhere on the web and import it through HTTP request (i.e. eliminate FMS from the process);

3. Do you have the FMPXMLRESULT.dtd document where the DOCTYPE declaration says it should be?

Can you try this with your own databases?

Sorry, no access to a server ATM.

  • Author

I got it figured out. It was two fold, the username and password should be in the url AND instant web publishing must be on for that user....

So, the Script step becomes....

Import Records [http://username:[email protected]/fmi/xml/FMPXMLRESULT.xml?-db=mydatabase.fp7&-lay=mylayout&-findall]

Excellent. And you are saying this works from a runtime? No doubt this could be useful to others.

Useful to me for sure........ It solves a question I've had in developing my runtime version even though most importing is from text files.

  • Author

To be specific, it's the Instant Web Publishing - Extended Security Privilege for the User that needs to be on Full Access. Not necessarily the Instant Web Publishing Configuration in the Server Admin Console.

––––––––––

Works from the runtime nicely. I too have been hoping to get this solved for ages. Glad to have it done so gracefully. As it should be!

Now to come up with an equally graceful way to push data to the server, hopefully without a plug-in. May need to use the WebViewer object.

Let us know if anyone comes up with something sweet.

Edited by Guest

If the server is configured for XML publishing, then the reverse operation, pushing data back to it from the runtime, should be no problem using a WebViewer.

e.g. to find the first record in Filemaker's sample database you might use a URL such as this to obtain its record ID:

http://127.0.0.1/fmi/xml/fmresultset.xml?-db=FMServer_Sample&-lay=English_Form_View&Title=Alaska%2024/7&-find

where you would replace 127.0.0.1 with host name, and would replace DB name, layout and field name appropriately. URL encode spaces. This searches db "FMServer_Sample" layout "English_Form_View" for book with "Title=Alaska 24/7". Presumably you'd search for a UUID field in a real DB.

To edit data once record ID is known from above query, or from runtime DB which might already know its ID, you might use:

http://192.168.0.21/fmi/xml/fmresultset.xml?-db=FMServer_Sample&-lay=English_Form_View&-recid=1&Author=New_Author_Name&-edit

to change the author field to New_Author_Name in record id #1.

I tested this and it worked fine. You may want to always do the find first, since ID's might change if records are deleted.

-new would be used for new record creation. If a large number of records require updating, then it might be better to ftp the differences via shell script, and have server import them, or import server file into a second table in DB, compare the two, and upload differences to server to sync.

You should be able to handle authentication with username:password@hostname:port in the server URL.

I'm not sure this qualifies as graceful, but it is relatively straightforward. The script would check for indicating success in both the find, edit and/or new operations, of course, before marking records as synced.

If it must be achieved with Instant Web publishing then I think you need to do form posts? ScriptMaster could take care of that.

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.