Skip to main content
1-Visitor
May 10, 2017
Solved

Is it possible to do a message service in thingworx studio?

  • May 10, 2017
  • 4 replies
  • 6008 views

I want to make an experience where I want to write some message and some other user who is using the same experience will get that message and will be able to reply back.

Is it possible? Any kind of solution is welcome...

Thank you...

Regards,

Dipika

Message was edited by: Sushant Pandey moving this to ThingWorx Studio for correct visibility.

Best answer by ankigupta

Hi Dipika Sengupta​,

In ThingWorx; Create a Custom Service (which takes String input and append the message to the property current value).

On Studio; we can use a widget to enter the message and one button widget.

Bind the text from the text widget to ThingWorx Service parameter.

Bind the Button click event to the Custom Service created above.

On click of button; ThingWorx Service will be invoked and takes input from the widget takes the input message. the updated data will reflect in ThingWorx platform.

I hope it helps.

4 replies

16-Pearl
May 10, 2017

Well the first "Thing" that comes to mind is implementing some kind of MQTT chat.

With MQTT you can publish and subscribe to certain topics.

Whenever a new message is posted, it will be automatically pushed to all the subscribed clients.

There's nice post from Franck in this thread: MQTT support in ThingWorx

This is of course done on the ThingWorx Platform side.

On the ThingWorx Studio side, you could then e.g. implement a text area and connect it to the MQTT-Thing on the Platform to receive the latest updates.

But that's just one specific example, depending on your actual use case there might be other, more suitable solutions.

5-Regular Member
May 10, 2017

Hi Dipika Sengupta​,

As per my understanding; you can try following:

On ThingWorx; we can have a Thing with a property and a Custom Service (which takes one input and append the message to the property current value).

On Studio; we can use a widget to enter the message and one to display the text message and one button.

On click of button data; ThingWorx Service will be invoked and takes input from the widget takes the input message.

Link the property from the ThingWorx Thing to the Widget that display the Message.

I hope it helps.

1-Visitor
May 12, 2017

Hi Ankit Gupta

I have created a property called NewTestProperty in the Car1 Thing. And have created a service called Test and in the script I have written "Test=me.NewTestProperty". Then I have linked the button to the service and the thing to a textbox. I am able to send data from the thingworx platform to the studio. But not the vice versa. Can you please suggest me some way to do that?

Thank you...

Regards,

Dipika

ankigupta5-Regular MemberAnswer
5-Regular Member
May 12, 2017

Hi Dipika Sengupta​,

In ThingWorx; Create a Custom Service (which takes String input and append the message to the property current value).

On Studio; we can use a widget to enter the message and one button widget.

Bind the text from the text widget to ThingWorx Service parameter.

Bind the Button click event to the Custom Service created above.

On click of button; ThingWorx Service will be invoked and takes input from the widget takes the input message. the updated data will reflect in ThingWorx platform.

I hope it helps.

16-Pearl
May 11, 2017

Hi,

This is a Great idea, I was looking for something like this a while ago, I was thinking about a type of contact me button.

Where the user can enter information into a text box. email address or telephone number and then select a contact me button.

Will be watching this topic closely.

1-Visitor
May 16, 2017

Hi Ankit Gupta

Thanks for your help. Can you please tell me if it is possible to send any thing other than text ( eg: Image, file) from thingworx studio to the platform?

Regards,

Dipika

5-Regular Member
May 16, 2017

Hi Dipika Sengupta​,

I have not explored this requirement so I am not sure if it's possible. I will check internally and will let you know.