Or just scrape the webviewer for what you need (not compatible with WebDirect).
The attached file shows how I did it. Its basically part of the function to use the attribute window.location to pass the data back via an FMP protocol.
JS_Math.fmp12.zip 142.8 K
You can use an FMP URL to get data from a web viewer back to FMP. I have several example on my github page:
All these are totally open so you can inspect to see how they work.
Trying to scrape the webviewer content is a non-starter, but if you need webdirect compatibility, you could use the suggestion to add some CWP to get the data back to the server and accessible in your webd session.
I am using the Soliant AJAX POST example to make a call and return the result to FMP, however, I am running into a few issues that I could use some help with.
The main issue I have is that I can only return 460 characters into the variable that is set from the FMP url call.
The results that I will be getting will have a length in the range of 15-20k characters.
What is the best way to pull get the data into FMP?
Already kind of answered that:
Using this method, you can pass a UUID via URL to filemaker and have a script go find that matching record to recall the larger chunk of text you are trying to pass through.
I saw the original post, however, as an internal developer I have not done anything with PHP or CWP as of yet. I was just trying to make sure I was exploring all available options before starting to research what I would need in order accomplish the path you stated.
If you know of any good demo files or articles for PHP/CWP I would love to know about them.
1 of 1 people found this helpful
The sixfriedrice intro was written almost ten years ago but is still a good read today:
Here are some more:
Here's what I got working:
1. I have the webviewer POSTing data to a PHP page that simply creates a serialized text file on the web server containing the processed POST data.
2. After the POST method is completed via AJAX, I used window.location.assign(); to trigger an fmp:// URL that launches a script telling the webviewer to navigate to the created text file on the web server. The script then pulls the data from the webviewer and does whatever I need it to do.
It works perfectly, every time. Here's my problem: I want to take it one step further by completing the POST method from a webpage generated via a data URI so that I can customize the calculated JS every time the process needs to run. On a Mac, no problem, it's working fine. Data URI support is fantastic and works really well. On a PC running Internet Exploder, nope. IE barely supports data URI's and I can't seem to get it to work. I'd even settle for an HTML document exported from FM and then loaded via file:/// into the webviewer, but I can't get the POST method to complete from a local document inside of the webviewer either.
Any ideas on this? All of our systems are Mac-based, but I'm trying to build a solution that will work universally.