Solved

Data from Website

Posted on 2011-09-25
2
395 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

864 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

23 Experts available now in Live!

Get 1:1 Help Now