Context
After several weeks we've finally been given the access we need to confirm Technolution's claims about their Slate service's uptime and security. Embedding the form in a page on Express requires inserting javascript specific to that form.
It is still unclear who has access to the export code within Slate, but we need a form that allows the key values of the javascript to be saved in Drupal. It might make the sense to do this as a custom block, but we really need to get actual values to work see that the form looks like.
This information can be found at https://technolutions.zendesk.com/hc/en-us/articles/216174328-Form-builder-dynamic-embed-and-query-string-parameters, but only if you have administrative access the Slate database.
The form builder supports both "simple" and "dynamic" embeds. Both methods use <script> tags to inject the form into the hosting page's document object model (DOM), enabling the form to receive all of the CSS styles from the hosting page. Both methods insert the form through AJAX-friendly methods (i.e. no "document.write" is used). Both methods provide field validation, address validation, and submit the data back into Slate. The difference then lies within the capabilities of pre-filling the form and passing query string parameters into it as well as adding the form through dynamic script. You can use the dynamic embed regardless of whether or not you choose to utilize these integration points, too.
When using the dynamic embed, Slate will read in the query string parameters that were passed to the hosting page.
There are two types of query string parameters:
- "person" - By sending a "person" parameter with the unique identifier (oftentimes called a "Prospect ID" or "Person ID" in Slate---this is different than their Slate ID and is a 32-byte GUID), any system fields on the form will be prefilled for the registrant, and the submission of the form will update that specific record
- "form_EXPORT" - By sending a parameter like "form_sys:first" or "form_myOtherField", you can prefill a form field with a specific value. This can be used on embedded forms with the new "invisible" flag set to prefill a program of interest, for example, where the form is embedded on that program's website.
If a form is embedded on the page http://myuniversity.edu/my-form.html, to prefill a form for a specific student you would link to the following address in your email message, provided that Prospect-ID is a merge field in your mailing: http://myuniversity.edu/my-form.html?person={{Prospect-ID}} If your webpage already includes a query string parameter, you will need to append this additional parameter with an ampersand (&) instead of a question mark.
If you wanted to prefill a program of interest with an export label of sys:program and a value of "Chemistry":
<div id="form_211afdcd-26ad-4084-8b41-349d8d55f09a">Loading...</div><script>/*<![CDATA[*/var script = document.createElement('script'); script.src = 'https://myuniversity.edu/register/?id=211afdcd-26ad-4084-8b41-349d8d55f09a&output=embed&div=form_211afdcd-26ad-4084-8b41-349d8d55f09a&form_sys:program=Chemistry' + ((location.search.length > 1) ? '&' + location.search.substring(1) : ''); var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(script, s);/*]]>*/</script>
The "form_EXPORT" query string parameters may also be used in a simple embed (if including them statically in the embed code), and both the "person" and "form_EXPORT" parameters may be used when linking to a form hosted directly in Slate.