Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 4008 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I am trying to get some XML data (currency exchange ) inserted into a field, but not luck.

 

URL

http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22USDCAD%22)&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys
Posted

Please elaborate on the process (you posted this in Calculations!) and on "no luck".

 

Also, why don't you import the response, instead of sticking it into a field?

Posted

attached is my test file.  Test on left, desired on right.  

 

I figured I could push the URL in to a field to be parse by the custom function.

Import sounds like a good idea, but to be honest I have never tackled xsl.

 

 

insertXMLurl.fmp12.zip

Posted

I'm afraid I am stuck with version 11 ATM, so can't look at your file.

 

 

Import sounds like a good idea, but to be honest I have never tackled xsl.

 

If you can post a link to the API specs, I'll help you with the XSLT.

Posted

correction 

http://developer.yahoo.com/yql/console/?q=show%20tables&env=store://datatables.org/alltableswithkeys#h=select+*+from+yahoo.finance.xchange+where+pair+in+(%22CADUSD%22)
Posted

Hey Comment, this is great, I appreciate the help. Thank you.

 

Q:  What details did the API url give you to help with this?

Posted (edited)

Q:  What details did the API url give you to help with this?

 

None, really. I was trying to understand if there was a way to get some control over the response through the URL. It seems that this is an undocumented service; I am not sure how you stumbled upon it.

 

 

Update:

The description can be found here:

http://developer.yahoo.com/yql/console/?q=show%20tables&env=store://datatables.org/alltableswithkeys#h=desc+yahoo.finance.xchange

 

But alas there is no more info there to be found.

Edited by comment
Posted

FYI: when converted to fmp12, the import mapping dialogue will show the left side but zero records to import. 

 

UPDATE

Client12 - works

Client13 - does not work

Posted

I took the xml results and built a static source file which worked.
I am now looking to see if there are any fmp13 release note about this.

Posted

my php guy came up with this:

<?php

// Get cURL resource
$curl = curl_init();

//Define header array for cURL requestes
$header = array('Contect-Type:application/xml', 'Accept:application/xml');


// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, array(
	CURLOPT_HTTPHEADER => $header, //Set http header options
    CURLOPT_URL => 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22CADUSD%22)&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys',
    CURLOPT_HTTPGET => TRUE //Set cURL to GET method
));
// Send the request & save response to $resp
$resp = curl_exec($curl);

// Close request to clear up some resources
curl_close($curl);
exit;
?>

this is an extra layer, but for now it should do, while I investigate FMP or perhaps I will investigate another source for exchanges rates

 

Posted

wow, complete bust on the XML. Had to write script loop incase import resulted in a null, then when I set a schedule on server13 (win) it was giving me 718 errors.

Plan B!

URL: http://rate-exchange.appspot.com/currency?from=USD&to=CAD&q=1

result: {"to": "CAD", "rate": 1.11666, "from": "USD", "v": 1.11666}

inserted url into a field then parsed.

Just one of those days.

(Hey Comment, as always, thanks for your time and help)

Posted

I don't know: it seems very strange to me. There has been a change in v.13 with regard to requesting a XML response, but I don't think it should break existing requests. Have you tried reconstructing the import step from scratch in v.13? If it doesn't work, you should report it as a bug.

This topic is 4008 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.