Skip to main content
1-Visitor
July 25, 2016
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)

  • July 25, 2016
  • 1 reply
  • 1711 views

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

1 reply

5-Regular Member
July 25, 2016

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.

psaxena1-VisitorAuthor
1-Visitor
July 25, 2016

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