cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

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

psaxena
1-Newbie

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 2
supandey
19-Tanzanite
(To:psaxena)

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.

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

Top Tags