Placeholders

Syntax

Google sheets may contain placeholders that are recognized by the Google Sheets Connector when sheets are added. These placeholders indicate where live values should be substituted. Placeholders take the following form. In this example, placeholders are named “tag1”; the placeholder name is exposed as a tag connection point in tasks.

Placeholder Live Value substitution relative to the placeholder cell
#tag1# In-place
#:tag1# Left
#tag1:# Right
#|tag1# Above
#tag1|# Below
#:append# Append rows below and on the left for all placeholder cells on the left
#append:# Append rows below and on the right for all placeholder cells on the right

In addition to the tag value, placeholders or target cells may also be substituted with a tag value’s timestamp, status, status text, or name, by appending a suffix to the placeholder:

Short Suffix Long Suffix Substitution
#tag1.v# #tag1.value# Value (the default when a suffix is ommitted)
#tag1.t# #tag1.timestamp# Timestamp (UTC)
#tag1.s# #tag1.status# Status Code (a zero value here means the value is “Good”)
#tag1.st# #tag1.statustext# Status Text (i.e., “Good”)
#tag1.n# #tag1.name# Name of the tag

Tip

Use placeholders in staging sheets that do not substitute live values “in-place”. For example, use placeholders that substitute live values on the right of the placeholder cell instead. This makes it easier to add placeholders later since previous placeholders remain even after some live values are written.

Add placeholders to your sheet

Enter placeholders directly into cells

Open your Google sheet, then type the placeholder text into cells following the format described above. After you have finished editing placeholders, add the spreadsheet to the Google Sheets Connector. See an example here.

Copy a connector topic

Right-click on a connector topic of another connector in the navigation panel (for example, the OPC UA or MQTT connector), then select “Copy Google Sheet placeholders”. This will place placeholders for all tags within the connector topic onto the clipboard; you can then paste the placeholders into your Google Sheet. After you have finished preparing your spreadsheet, add the spreadsheet to the Google Sheets Connector. See an example here.

“Send to” New Google Sheet

Right-click on a connector topic of another connector in the navigation panel (for example, the OPC UA or MQTT connector), then navigate to menu “Send to” / “Goggle Sheets Connector” / “New Google Sheet”. The dialog will prompt for required details.

../_images/googlesheets-send-to-dlg.png

Enter your spreadsheet ID (1) or simply copy the URL of your spreadsheet (for example “https://docs.google.com/spreadheets/d/2UV7qd0Z_dgwqTc8QQ7fgyuWtyghIPa5TbZGee-8A-qD…”) that is to contain the new sheet, enter the new sheet name (2) and optionally check “Append values” (3) to append values in new rows. Make sure the the service account configured for the Google Sheets Connector has access to the spreadsheet.

Finally, press the “Create” button to create the new Google sheet. At the same time, a new task is created to transfer data to the new sheet and you can begin sending data to the sheet by starting the task.

See an example here.