Skip to main content
17-Peridot
July 7, 2016
Question

I want to show data from 2 different sources in one table

I have the part information from windchill that shows me number lifecycle state etc.

WC Part numberLifecyccle state
123456789RELEASED

on the same mashup I can display the erp info like cost and stock for the same part. how do I show this in one table?

ERP part numberCostStock
1234567892510

Like this

Part numberLifecycle statecostStock
123456789RELEASED2510

7 replies

July 7, 2016

You can make service for windchill separately and one for erp.

Then you can club the services by calling the service name using Union script available in the thingworx composer.

Translate
BryanK17-PeridotAuthor
17-Peridot
July 7, 2016

Hi,

Thanks. Can you elaborate on how to do this?

I'm not sure what you mean by club the services and calling the service name?

Translate
July 7, 2016

Hi,

You can call first the windchill service and store it in the infotable.

var params = {

  Windchill: Windchill /* STRING */;

};

var result1 = me.getWindchill(params);

Then you can call erp service and store it in the infotable.


var params = {

  erp=erp;

};

var result2 = me.geterp(params);

Now, you can call the above infotables and combine them using below script:

var params = {

  t1: result1/* INFOTABLE */,

  t2: result2/* INFOTABLE */

};


// result: INFOTABLE

var result = Resources["InfoTableFunctions"].Union(params);


and now u can bind the service output to mashup.


Thanks,

Aditya Kumar

Translate
10-Marble
May 22, 2017

Translate
BryanK17-PeridotAuthor
17-Peridot
May 22, 2017

Hi,

To retrieve the data I'm using the Windchill connectors to get the windchill data. For the ERP I'm using the standard database drivers.

The problem that I have not yet figured out yet is to some how bring those into one service and use the suggested join scripts.

Bryan

Translate
1-Visitor
May 23, 2017

You must implement a Helper Thing let's call it "MyJoinedConnector" and add up a service which calls the previous Connectors and returns the Joined result.

Then you just need to add up MyJoinedConnector on your Mashup and call the given service to show it on the grid.

Translate
1-Visitor
May 22, 2017

Hi, instead of union what you need it's Intersect snippet:

var params = {

  columns1: "*",

  columns2: "Cost,Stock"

  joinType: "INNER",

  t1: result1,

  t2: result2,

  joinColumns1: "WC Part Number",

  joinColumns2: "ERP part number"

};

// result: INFOTABLE

var result = Resources["InfoTableFunctions"].Intersect(params);

Translate