Solved

Data from Website

Posted on 2011-09-25
2
385 Views
Last Modified: 2012-05-12
Hi
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.
0
Comment
Question by:Krisraychris
2 Comments
 
LVL 24

Accepted Solution

by:
Will Loving earned 500 total points
Comment Utility
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 http://www.exchange-rates.org/currentRates/E/GBP 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:

0
 
LVL 10

Expert Comment

by:webwyzsystems
Comment Utility
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.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
This video discusses moving either the default database or any database to a new volume.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now