I used ScriptMaster from 360Works to download the html into a container field. Is there a way of displying it in webviewer without leaving Filemaker?
If you have inserted the HTML into a field (global storage, perhaps?), then this will help:
"Displaying HTML in a Web Viewer"
Along with this help topic ("Set Web Viewer"):
So depending on version, you may be able to just point to the field containing the HTML. Or you may need to use the:
"data:text/html," & <<yourfieldhere>>
"data:text/html," & <<yourfieldhere>>
Thank you very much for the quick respnse Beverly!
Global storage will not work since each record has a own html file stored in the container. I am attaching a screenshot to explain my problem better. It has 2 webviewers, one based on the URL (BBC) and one based on an html file in a container, that does not display correctly at the moment. I want to be able to visually inspect the current webpage with the one stored in the container. I tried your recommendation: "data:text/html," & <<yourfieldhere>>. It only now displayes the file name but not the page. Do you have any idea how to fix that?
You didn't specify version, so I'll say this should work regardless (put in the web viewer or use the script step to set it):
"data:text/html," & URL As Text
You cannot the a container field for this, or you get the name of the file as you saved it in the container.
IF you must use the container field, then you need to change the call from text/html as what you have in the container is now a binary file (even though it may be "text" if you insert or export it).
Please let me know if the URL as Text (the actual HTML in the text field) is not going to work and why?
I am using Filmaker Pro Advanced 14, but can also use FMP 16.
The container stores an html file called: “index.html”.
THe aim is not to display it as text but as hmtl in web viewer.
Correct. I've recreated your sample in FMPA.
1. The URL works as is
2. The TEXT of the page in a text field can be used as I previously stated:
"data:text/html," & TABLENAME::URL as Text
However the usage of the TEXT of the page in the web viewer does display the page. It's not connected to the web site, so links may or may not work (or work correctly). IF such a link does work, it simply reloads the Web Viewer with the new URL and is no longer the TEXT from the Index.html page.
3. The "file" in the container cannot be displayed this way. The Web Viewer does not directly display the FILE.
I ask again, is it important to use the file in the container?
Yes, it is important to use file in container, since URL may have changed. I want to compare the file in the container to the current URL and see what the differences are.
OK, how are you proposing to compare what is stored (file) with what is current (url)? A few more clues, please?
FileMaker can compare when the contents are the same type (Text-Text, for example). I'm not so sure container-container can be compared (directly).
I'm alluding to ways that may work (even in FMPA14). There is the Base64Encode() for example that 'converts' a container to Base64. https://en.wikipedia.org/wiki/Base64 This is a BINARY file (in the container) that becomes Text.
But IF you already have the TEXT of the page...
I might have missed what you are using ScriptMaster for, except to actually push the page directly to the container. Is that correct? and in your example, was the URL as Text just for reference, or are you storing that as well?
There may be a few new functions in FM16 that can help as well.
The ldea was to do this visually, comparing what is beig displayed in webviewer based on URL against what was captured previously and was strored as html file in a container. Comparing 2 web viewer windows.
The URL to text comparion - current to previous - indicates where a website was updated. But I need to see whether a certain part of information is still the same (prices).
I am attaching a screenshot.
Currently the file compares the webpages converted in text, the graphics of the webpage and the file size of the html file.
I cannot get the visual comparison going.
And I think therein lies the problem. If you already have a TEXT comparison, why does a FILE comparison need to be done?
Text compariosn does not help much with dynamic webpages. There is always a difference second by second. But that does not mean that the piece of info I am after has changed.
Correct! As I read further, you are needing to "scrape" the contents of the web page(s) for specific information. And if this information is changing that rapidly, you may need another method to get that information.
Not really. The info I need chnages maybe once or twice a year. But other things of webpages change. A text to text comparison is hence not enough. I could export container content and then open it in Browser to then compare to current, but that is awefully complicated. Hence my question whether I can display a html file stored in a container in a web viewer.
Thank you for your post!
I'm going to move this thread from the FileMaker Community Feedback Space (which is specifically for input on the Community itself) to the Discussions Space where it might be easier for other users to find.
I believe you can do this without having to extract the text from the container field.
If you use the function GetContainerAttribute( sourceField ; "MD5" ) on both old and new container fields, if there is any difference, then MD5 hash will be different. Does that do what you need?
If you use MBS FileMaker Plugin, you can use the WebView.LoadHTML function to load html.
And you can use Container.GetText function to get the text from the file in container.
Thanks for the response Mike. I used 3 different ways of checking whether a webpage has changed.
1) URL to text
2) graphic links within URL
3) Container attributes of the container that holds html file (the approach you suggested)
After establishing these 3 approaches I realised that some webpages instanly change (dynamic webpages). So there 3 approaches would sound unnessary alarms.
Which leaves me to check myself whether a material change has taken place. For that I would like to display the stored html file in webviewer, so that I can compare it to the webviewer showing the current url.
Have you found a way to extract the text from the html file stored in the container? You might use the base64 encode then decode method to save into a text field. That can be handy.
Aside from that, hopefully they have some html tags you can use to get to the "meat" of the page that you can then compare for what you need to.
I suggest using Insert From URL to get the data into a field. As stated by Mike, You can scape for the html tags, which usually do not change, for the data you need.
Dear Mike: I used the ScriptMaster plug in for URL to text conversion.
Dear Schamblee: Thanks the Insert From URL is a good alternative the the Scriptmaster plugin.
May main problem is to display the html file that is stored in a container in the webviewer, without having to leave Filemaker..
You have put the HTML file of your page into a container. This is the TEXT that can be shown in Web Viewer, but only if it is converted back to the TEXT (not the binary file stored in the container). If you already have the TEXT in a field, it should be exactly the same.
I tried but it does not seem to work. I specified in webviewer the text field that contains the webpage text: URL to tetx script from Script Master.
I know there are several comments on this. Go back and read about where the
"data:text/html," & ____ TABLE::FIELD ____
is put into the Web Viewer.
I made a test and it works for me with your URL. I can post my Demo if you need.
EDIT: I've attached the file (FMP 14 Advanced) that will open in several FMP versions. Study the middle Web Viewer in Layout mode.
You are a star! It worked. Thanks a million.
Retrieving data ...