Skip to main content
1-Visitor
January 25, 2021
Solved

Unable to provide state based formatting to Shape

  • January 25, 2021
  • 1 reply
  • 2673 views

Hi All,

 

I am building a mashup in Thingworx 9.0  where I have to display status of machine i.e. either running or stopped. I am getting that status via a service which I have binded to a data shape.

Requirement is to show status of machine in green if machine is running and red if machine is stopped. I used value display to show the value status and in background I placed a shape whose colour will change as per status of machine.

I have binded data of service to shape, but i am not able to find exact state formatting to achieve this result. Currently i have configured ALERT TYPE(as shown in attached image). Kindly suggest how to achieve this. I have attached an image showing the objective that needs to be achieved.

Best answer by odukiya

Hello @VK_9460892 

 

Sorry for the late reply here. You can refer the following post to achieve your use case.

https://community.ptc.com/t5/ThingWorx-Developers/How-to-Change-Grid-Cell-Color-Based-upon-value-coming-from/m-p/526350

 

I tried it the following way and it worked

1) Created a service where result is string ( 'Running' or 'Not Running')

2) created a new State definition (colour test) with 2 new state string definition for both values

3) bind the output of service to shape data

4) when trying to set state based formatting select the one you have created (Colour Test)

 

I hope it will work for you,feel free to revert in case you face further challenges.

 

Thanks

Om Dukiya

1 reply

16-Pearl
January 25, 2021

Hello @VK_9460892 

 

Please refer following post for your problem

https://community.ptc.com/t5/ThingWorx-Developers/Creating-a-Thermometer-from-a-Shape-Widget/td-p/521379

 

Let me know if it doesn't resolve your issue.

 

Thanks

Om Dukiya

1-Visitor
January 26, 2021

Hello @odukiya 

 

Thanks for taking out your time to respond to my query.

I have already applied the colour changing filter on progress gauge, based on range concept given in your provided solution in the thermometer post. It is working perfectly fine.

However, here I need to use string as an input and change colour, which is not working for me.

Kindly suggest. Thanks.

odukiya16-PearlAnswer
16-Pearl
February 5, 2021

Hello @VK_9460892 

 

Sorry for the late reply here. You can refer the following post to achieve your use case.

https://community.ptc.com/t5/ThingWorx-Developers/How-to-Change-Grid-Cell-Color-Based-upon-value-coming-from/m-p/526350

 

I tried it the following way and it worked

1) Created a service where result is string ( 'Running' or 'Not Running')

2) created a new State definition (colour test) with 2 new state string definition for both values

3) bind the output of service to shape data

4) when trying to set state based formatting select the one you have created (Colour Test)

 

I hope it will work for you,feel free to revert in case you face further challenges.

 

Thanks

Om Dukiya