FAQ

What is FAQ?

Disclaimer: Datasources and variables in the examples were previously created for example purposes only.

Settings

1. How do I change settings programmatically?

  • To get the settings programmatically, use datasources.myDatasource.settings();
  • To Set the settings programatically , use datasources.myDatasource.settings({ ...datasources.myDatasource.settings(), refresh_interval: 50

This can be done in the widget’s parser.

Make sure to use the spread operator followed by properties/settings which needs to be changed programmatically. Example: “of changing the message settings….”

Datasource

1. What are the different methods available on a datasource inside of a parser?

  • Users can access the selected datasource by using this.dsModel. Then pair it with methods such as sendData to call on them after being accessed. Ex. "this.dsModel.sendData(insert datasource name here);"
  • 'datasources' is used inside of the widget parser and gives the user the freedom to use any of their datasources. Examples:
  • datasources.myDatasource.sendData(insert datasource name here);
  • To retrieve latest cache for a datasource, use datasources.myDatasource.latestData()
  • To subscribe and unsubscribe to updates on a datasource, retrieve the data first and assign it to a variable - const updateCb = (data) { //do something with data } then use- datasources.myDatasource.latestData.subscribe(updateCb) datasources.myDatasource.latestData.unsubscribe(updateCb)
  • if(datasources.myDatasource.lastUpdated){ const data = datasources.myDatasource.latestData(); }
  • To reach out to the server and update cache- datasources.myDatasource.refresh()

2. How do I change the message topic on a datasource?

  • Create a new HTML widget and use your message topic as your datasource
  • Edit the parser to include this code:

Make sure to change ‘msg’ to the name of your topic and ‘newTopic’ to the topic name you want to change to

  • Save changes and see the change appear when you open the message datasource settings

Widgets

1. How do I set up permissions for rule builder?

Permissions needs to be added to the system’s:

  • Code Services
  • Triggers
  • Roles

This can be done in the Roles section of the system. It is recommended to add a new role specifically for the rule builder.

To learn more about adding new roles and permissions to a role, go to (enter roles link here)

2. How do I use the list widget to update other widgets?

Here is an example between the text and list wiget:

  • Create a local variable
  • Add the list widget to the pane using the local variable as the ‘Selected Item’ datasource
  • Add the text widget using the local variable as the datasource
As you switch items on the list the text will change to the item’s id.