Pass App Data to XSight Topics Using JavaScript

Before you begin

This procedure requires an XSight topic. See Create an XSight Topic.

About this task

Use this procedure to map widget data to your XSight topic data connection rule using JavaScript.

Procedure

  1. Open your app in the Canvas.
  2. Select the widget that triggers the transfer of information from your app to SOTI XSight.
  3. From the Events tab, select the Events list.
  4. Select an event, like On Click, to trigger the information transfer.
  5. From Actions, select to add a new action.
  6. Select Run Javascript.
  7. Select Script Editor. The Script Editor window opens.
    Script Editor window
  8. From Script Name, give a brief description of the script's purpose.
  9. In the editor, create script commands to pass widget data to your XSight topic data connection rule. Use the command Snap.xSightTopic.setValue("[topicName]", "[topicValue]").
    Examples: In the following example, the [topicValue] is the value held by the widget.
    Snap.xSightTopic.setValue("PatientName",Snap.widgets.textbox.getValue("txtPatientName"));
    Snap.xSightTopic.setValue("SugarLevel",Snap.widgets.radiobutton.getValue("radSugarLevel").val);
    Tip: To find and insert an XSight topic name into your code, select Global variables button. Select the XSight Topic tab and choose the name of the XSight topic.
  10. Select Done.

Results

Widget values from your SOTI Snap app can pass to SOTI XSight through your XSight topic data connection rule.

What to do next

Switch to SOTI XSight and configure SOTI XSight Live View to use your XSight topic data. See Map XSight Topics in SOTI XSight.