It is possible to fill in a form with the WebViewer if the web page accepts the data as "GET". This means that you can encode the field's value as a parameter value passed with the URL. (example.com/somepage.html?var=value).
But I don't think the FileMaker's "POST" method (httppost) is supported for a WebViewer URL.
As a workaround you can use the Insert from URL script step to use httppost and store the response html in a field, e.g. MyURLResult
Then display the contents of that field in the WebViewer via the URL
"data:text/html," & MyTable::MyURLResult
So how do I know if the web page accepts the data as "GET". ? And when you say you can encode the field's value as a parameter do you mean my database field "Field One"? And do I have to name the web viewer object name?
Sent from my Bell Samsung device over Canada's largest network.
So how do I know if the web page accepts the data as "GET".
If the web page is not under your control, determining if it accepts GET or POST or both is something you'd have to research.
While the html source of the page may specify method="post" in the <form> you use to submit data, it is possible that the web page where the form is submitted will accept either GET or POST. You could ask the site owner or just test using GET and see if it works.
And when you say you can encode the field's value as a parameter do you mean my database field "Field One"?
"http://www.example.com/thePage.html?param=" & GetAsURLEncoded(MyTable::Field One)
And do I have to name the web viewer object name?
I think you would only need to do that if you use the "Set Web Viewer" script step. That script step requires the Web Viewer object name.
Thanks all for the help and patient. I think I'm getting closer to understand. So Tom, the ""http://www.example.com/thePage.html?param=" & GetAsURLEncoded(MyTable::Field One)" is set in the web viewer settings and the GetAsURLEncoded will see the info in the Field One field and send it to the "www.example/theSpecifcPageField" is that it? I might be still a little confuse on were to put all this. A small sample file would be nice.
You really don't have to do anything special to pass FM data from a field to a webviewer. The contact starter solution uses google maps which passes the address from fields to the webviewer to process and retrieve the map. The starter solution uses a custom function but it's not required.
Still no luck, can someone help me with step by step.
How to format "Field One" as calculation or just as plain text field.
What to put in the Web Viewer "Web Address" box.
Do I need a script.
You don't know. Some sites block GET, but allow POST. It's another way to prevent attacks.
As Beverly states it cab be different for each website / api.
Here is a google maps sample of a calculation field. The address and google maps setting are passed from fields in the database.
address = Substitute (
address& " " &
""& " " &
city & " " &
state & " "&
zip & " " &
" " ;
" " ; "+"
) //stores the complete address in the address variable
size = GetLayoutObjectAttribute ( "Map1" ; "width" ) & "x" & GetLayoutObjectAttribute ("Map1" ; "height" )
] // Set the size variable to the size of the webviewer field which is passed to the google API. Example (300x300)
<meta name='viewport' content='initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no' />
<img src='https://maps.googleapis.com/maps/api/staticmap?" &
"&size=" & size &
"&scale="& scale &
"&zoom=" & zoom &
"&maptype=" & MapType &"' >
// address is set in the let statement, which combines the complete address into one variable.
// zoom is passed to the google api to set the zoom level of the MapType
// size is used to set the size of the map to fit the webviewer
// maptype is the type of map to display.
// "" is left for other options that can be added to the url api call
// most items need to be in lower cases to work with the google api