Populating Web Forms
When you're dealing with any type of web service which doesn't offer an API for data exchange, you'll inevitably end up working with a web form for getting data into that service. Data has to get in via some method and the most common is your standard web form.
Maybe you need to interact with a Google Form or some other public form service. While some of these services will provide a standard format such as CSV for pulling data out, there are still those services where you need to popuate a web form using your own data.
So, when it comes to moving data in and out of FileMaker, via a web form, you need to use the tools available. The great thing about this situation is that JavaScript is the tool and you have it right there ready for you to use. The humble Web Viewer is your gateway to getting your FileMaker data into a form. This video walks through the JavaScript and setup you need to know in order to interact with pretty much any web form on the web. Learning these valuable tools
Comments
Changing field IDs
What can I do if the ID in the xpath of the field changes every time I reload the webviewer?
Mutable XPath IDs
If the element is getting a new XPath ID every time you load the page, the simplest thing to do is identify the element using CSS selectors: when you right-click to copy, choose the "selectors" option instead of the "XPath" option. Matt talks a little bit about this in the video at around the 42:00 mark. Selectors allow you to identify an element by an attribute such as ID or class or by element type (essentials, the tag) and its position within a collection - HTML can be thought of as a collection of elements; you can iterate through the elements in the same way you would iterate through an array (in FileMaker parlance, a "list of values" is probably the closest term).
This would mean, however, that your get and set functions would have to use CSS selectors rather than the XPath that Matt's existing code uses. It's not a huge change, but until you're familiar with selectors you might struggle. Start with https://w3schools.com and then search for more information on the web.
--
Daniel Farnan
Ignorance is curable, not preventable
Click a button
What is the procedure to "click" a button via script in a web format?
Thanks a lot.
Click a button
You would target the element of the button the same way he targets the fields in your function, and append ".click()" at the end. Parentheses are important because you are evaluating the click function.
Buttons have the same variety of html tags. It can be <button>, but it can also be pretty much anything else. In that case, it will often have a class that has "button" or "btn" in it.
Thank you TacticTGI,
Thank you TacticTGI,
in this example site (https://online.psagp.it/) I should be able to get the response generated by clicking on the "SEARCH" button, in the "Container Status" section located on the left in the middle of the page, which brings up a field with the related response.
Now, following Matt's beautiful video I can enter a data item in the "Container ID" field and get the response from the field that appears after clicking the "SEARCH" button. What I cannot do via script is precisely to "click" on the "SEARCH" button. Can you provide a practical example for the site in question?
Click button 2
please provide detailled information how to "click" the button of the google form which is filled with filemaker values in the file belonging to this (great) video
thank you