Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Data from Website

Posted on 2011-09-25
2
Medium Priority
?
449 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 25

Accepted Solution

by:
Will Loving earned 2000 total points
ID: 36598729
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
ID: 36816492
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Loops Section Overview
Suggested Courses

972 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