view.xml
This page lists all of the available tags within the view.xml file and how to access them from within the plugin
This file lets developers create a form that is displayed as a GUI when the plugin is created.
Its contents use Ubidots-mapped, XML-like tags that render as React elements. Because of this, it differs from traditional XML tags.
Form
This is the main tag because it wraps the entire form. It maps to a form element. It has the following attribute:
name: Document-unique text that identifies the form.
Example:
<form name="form-name">
...
</form>Group
This tag maps to a div in the DOM. It acts as a container and lets you group elements. It has the following attribute:
name: Document-unique text that identifies the group.
Example:
<group name="group-1">
<group name="group-2">
...
</group>
</group>This div uses CSS flexbox so it renders correctly in the front end.
Label
This tag maps to a label element in the DOM. It is usually used as the title for an input element, but it is not limited to that use. Its properties are:
name: Document-unique text that identifies the label.
help (optional): Help text displayed as a question mark icon next to the label. Clicking the icon reveals the text, which can also contain external links written in markdown.
Example:
Input
This tag maps to an input element in the DOM. This field can be password, checkbox, or text. Its properties are:
name: Document-unique text that identifies the input.
type: Input type. Allowed values are
password,checkbox, andtext.placeholder (optional): Helper text displayed inside the input field.
value (optional): Default value for the input.
The text and password inputs are sent to the plugin as plain text. The checkbox is sent as a boolean:
Paragraph
This tag maps to a p element in the DOM. It lets you include text blocks within the form. Its properties are:
name: Document-unique text that identifies the paragraph.
Example:
As shown above, this tag supports external links written in markdown. The link must include the HTTP or HTTPS protocol.
Map
This tag represents a map in the browser. Like any other form field, it lets users select a location through Google Maps. Its properties are:
name: Document-unique text that identifies the map within the form.
lat (optional): If allowed by the user, their position will be retrieved and
latwill be the user's position latitude. Else, it will be set to37.428458by default.lng (optional): If allowed by the user, their position will be retrieved and
lngwill be the user's position longitude. Else, it will be set to-122.160901by default.zoom (optional): Initial zoom value. The default is
12.type (optional): Map type. Accepted values are
roadmap,satellite, andhybrid. The default ishybrid.
Example:
The lat and lng values are sent to the plugin in an object like this:
This is how the map looks:

Select
This element is rendered in the browser as a dropdown. It lets users select one or more items from a list. Its properties are:
name: A unique identifier for the dropdown within the form.
type: Determines if the dropdown allows single or multiple selections. Accepted values are
singleandmultiple.search (optional): Enables a search feature within the dropdown. Accepted values are
enabledanddisabled.placeholder: A default message displayed in the dropdown before any selection.
value (optional): Default value for the dropdown.
Note: For a multiple dropdown, the default value must be a comma-separated string with no spaces.
For each case, the plugin interprets the values as follows:
Option
This tag represents an individual item within a dropdown. It can only be used inside a dropdown and cannot exist on its own. Its property is:
value: The associated value of the item.
Example:
Token
This dropdown lists all user tokens and lets one be selected for plugin configuration. Its properties are:
name: A unique identifier for the token within the form.
placeholder: A default message displayed in the dropdown before any selection.
Example:
This is sent to the plugin as:
Frequency
A text field with a label, both arranged on a single line. The text field is positioned inside the label based on a keyword. Its property is:
label: Descriptive text for the interval input field. The label can contain the
{field}keyword, which marks the position of the text field. If it is not included, the field is placed at the end of the label.
Example:
Connected Account field
This field lists all accounts connected to Ubidots, filtered by the provider attribute. It also lets users connect new accounts from the same provider. Its attributes are:
label (optional): Descriptive text for the field.
provider: Refers to the external service that can be connected. Currently, the only accepted value is
AWS_IAM. This attribute is case-sensitive.
Example:
Note: Information from this field can only be accessed from the control script through environment variables. Variables that reference this field use the AUTH_CREDENTIALS_ prefix.
Accessing view.xml elements from within the plugin
Any element in the view.xml file can be accessed from the plugin scripts, namely control and function. For example, suppose your plugin uses the following view.xml file:
To access this data in those scripts, read the _parameters key from the incoming JSON payload, which contains the function arguments.
In this case, the JSON would look like this:
If you want to get the value of the input-text field, use a snippet like this in your script:
Likewise, the input-password, input-checkbox, and age-range values can be read like this:
Last updated
Was this helpful?