Data from Website

IO would like to know how to copy data from a web page into a field in FM.
I would like to set up a server side script (FM SERVER 11) to open the website XE.COM and copy the selling price of a currency and paste it into a global field or which ever way it can be done. (Exchange Rate).
\I would appreciate any advise on this.
Who is Participating?
Will LovingPresidentCommented:
This is done in FileMaker by using a Web Viewer object on a layout and setting the Web Viewer to URL of the site you are trying to capture a value from. The challenge is that you will need to setup a calculation that extracts the data you want from the HTML code that the Web Viewer returns. If that code changes, or for that matter if the URL changes, you will need to alter your capture system.

To capture the text from a specific URL;

create a Web Viewer on your layout
In the Inspector palette, give the Web Viewer Object a name such as "WebViewer1"
Edit the WebViewer (by double-clicking on it) to use the specific URL that you are wanting to go to to get the Exchange Rate
In your script, use Set Variable to capture the resulting text from the URL using GetLayoutObjectAttribute ( "ViewerObjectName" ; "Content" ). In this case you would replace "ViewerObjectName" with the name of your Web Viewer Object
Using the PatternCount() and or other text functions, locate/isolate the particular string you wish to capture. If you are looking for the Exchange Rate for a specific currency, you will have to examine the code to see how that exchange rate appears in the code and then build a calculation to find a locate that specific rate. For example, if your URL is and you want to get the current exchange rate for British pounds in Euros, you would need to figure out the exact string of HTML tags that surrounds that value in the table and then extract the value from that string. As noted, if the URL or the web page structure changes, you will likely need to alter your calculation.

For a step-by-step description (written a few years ago) of how to do this, see:

For more detail on using the GetLayoutObjectAttribute() function, see:

If you have PHP experience and access to a web server, I think a viable alternative would be building a utility file in PHP to fetch and parse out this information for you. PHP has a much richer toolset to parse than filemaker.

This way when you use the web viewer, filemaker calls your own page and you get exactly what you want into FM, very little parsing around.

Lots more power available to you than in just filemaker alone. Its also nice to push the CPU time onto another process not in filemaker. Keep filemaker fast.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.