This field plug-in allows you to display content from a web source in an iframe as part of your form. The principle tested use case is displaying a web-published Google sheet graph, but the field plug-in may work well for other use cases. The content to be displayed needs to be public so sensitive information should not be shared this way. It uses an internet connection to display content.
- Supports displaying content that can be embedded in an iframe using a URL.
- Supports displaying the last update time, which is the last time the content was updated.
- Supports refreshing the content using the refresh button.
The plug-in requires the text field type. The field stores the following values:
success
- if the graph loads successfully.fail
- if the graph fails to load.
NOTE - The following message will appear if the plug-in is having issues with connectivity - Sorry, this is taking a while! Are you connected to the internet? Wait a few moments, and try the Refresh button.
The last updated time is recovered from the field plug-ins metadata using the plug-in-metadata() function.
- Download the test form extras/sample-form from this repo and upload it to your SurveyCTO server.
- Download the display-iframe.fieldplugin.zip file from this repo, and attach it to the test form on your SurveyCTO server.
- Make sure to provide the correct parameter (see below).
Key | Value |
---|---|
link (required) |
The link to the web-published content to be displayed in the iframe. For Google Sheets, you can follow the steps in this article to get the link to your chart. |
To display this sample chart in the form, you would have the following in the appearance column:
custom-display-iframe(link="https://docs.google.com/spreadsheets/d/e/2PACX-1vTD80eAbc3rcSYPu4hMoCOZDkyKZ0kD5SZ2FowYN-EXWlN0jrP4T22osV_P_9DgrJJum4FwFtt11NkX/pubchart?oid=148310736&format=interactive")
-
Sample form
You can find a form definition in this repo here: extras/sample_form. -
Developer documentation
More instructions for developing and using field plug-ins can be found here: https://github.com/surveycto/Field-plug-in-resources -
User documentation How to get started using field plug-ins in your SurveyCTO form. (https://docs.surveycto.com/02-designing-forms/03-advanced-topics/06.using-field-plug-ins.html)