Skip to main content
1-Visitor
Jul 25, 2016 6:20 AM UTC
Question

How to send current value of a property from ThingWorx to a web service on triggering of an alert(in the form of json)

when an alert is triggered, the instant value of that property should be passed to a web service through a json.

2 replies

5-Regular Member
Jul 25, 2016 8:22 AM UTC

Hi Priyanshi, you can try the following steps to achieve what you are looking for :

  1. Create an alert on the property, if doesn't already exist
  2. Create a service that outputs the data in the required data type e.g. Json which needs to be passed to the web service (see screenshot below) and for getting the current value of the property you can use the Stream and it's generic service GetStreamEntriesWithData or QueryStreamEntriesWithData (depending on your requirement)

     3. Create a subscription with Event -> Alert and select the Property on which the Alert will be fired and you would call this service created in above step (Step 2)

Hope this helps.

Translate
psaxena1-VisitorAuthor
1-Visitor
Jul 25, 2016 9:04 AM UTC

How to get the value of a property at that very instance when the alert is triggered. Please could you provide some sample code for the script to get the current value from property in json form

Translate