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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Is it possible to mergre services in a grid widget from more than one Thing?

kt1
3-Visitor
3-Visitor

Is it possible to mergre services in a grid widget from more than one Thing?

Hey,

Do basically I am gathering temperature data from several devices and I have created different Thing for each device with different properties. Now I want if the temperature exceeds a limit it should display a warning in the grid. I am able to do this for one Thing but not for several Things in one grid.

I have attached a picture to explain my problem in a more better way below.

11 REPLIES 11
posipova
20-Turquoise
(To:kt1)

You can create a service that will merge data from all of the things and then use the output to bind it to your grid. The grid itself will take only one source of data.

kt1
3-Visitor
3-Visitor
(To:posipova)

But how can I do that because whenever I create a serivce it is always in a thing. So it by default works with the property of that thing right?

posipova
20-Turquoise
(To:kt1)

You can pull data from any thing inside any service as long as you have the right permissions.

posipova
20-Turquoise
(To:posipova)

Example: referencing Thing1 in Thing2:

kt1
3-Visitor
3-Visitor
(To:posipova)

I tried doing what do said and than in mashup in my grid widget I tried to connect my 'getvalueproperty', but it still shows me the value from the thing under which I created the service and not from the one that I added.

posipova
20-Turquoise
(To:kt1)

Can you copy-paste your full service code in here?

kt1
3-Visitor
3-Visitor
(To:posipova)

I tried to do the exactly the same thing as you have done. I am attaching a few images of how I did it.

1)

I thought if I only added  "var result = Things["Sensor_data_DHT11_thing"].GetPropertyValues();" than in the info table it will only display the data from DHT11 so I added "var result = me.GetPropertyValues();" so that in my info table both of them are displayed.

2) I tried to test the services but it doesnt show any data.

3) I don't know how to know how to connect my grid widget to my service created.

To Run a service for any instance you have to add the service to the Template this could be a service wrapper or direct service for example getProperties using the Dynamic option  this will pass the Entity selected from say a GetImplementingThings and use the selectedRow  from the returned Data to get the selected Entity Or use a service helper

Some images to help

kt1
3-Visitor
3-Visitor
(To:sgreywilson)

Hey, I am new to thingworx I am understanding what you are saying and I tried to follow what you said but I have still not reached my goal. I am attching some pictures below to show you all the steps I have done uptill now.

So I selected a template, set it dynamic and then selected Get Properties.

Now my mashup looks something like this

Now I want to display properties from two different things in this grid widget I don't understand if I have to create a service in my template for this two different things or is it something else.

posipova
20-Turquoise
(To:kt1)

You have to set your output result to "infotable" instead of "nothing"

From the grid image it does look like you did set the output to a InfoTable because there are columns headers

The next question is are you sure the getProperties executes. This will be based on a selected row change event assuming you have a list of things to select from. Can  you take a few snapshots of the entity side or even export the mashup and things you are using.

Top Tags