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

Creating datashape relevant to saved search table in windchill

SOLVED
Marble

Creating datashape relevant to saved search table in windchill

Hi all, I'm trying to fetch the saved search table from windchill in thingworx. Please suggest on how to create datashape relevant to that particular table?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Creating datashape relevant to saved search table in windchill

This issue is fixed. We created data shape based on the internal ID of windchill data and it started working. Thank you for following it up.

View solution in original post

4 REPLIES 4

Re: Creating datashape relevant to saved search table in windchill

Can you be more specific and explain what exactly you trying to do? Are you trying to execute saved search and create data shape from data returned from that? If possible attach service code example.

Re: Creating datashape relevant to saved search table in windchill

Yes. I'm trying to execute saved search. I'm using the below code. Here "ptc-sample-ds" is the datashape which I created according to the saved search table.  But apart from name and state other columns does not have values. I need help to fix this.

 

// result: JSON
var csrf_token = me.Security_Get_CSRF().items[0].attributes.nonce;
var params = {
infoTableName : "InfoTable",
dataShapeName : "ptc-sample-ds"
};
// CreateInfoTableFromDataShape(ptc-part-demo-shape)
var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
var select = "";
// infotable datashape iteration
var dataShapeFields = result.dataShape.fields;
for (var fieldName in dataShapeFields) {
select += ',' + fieldName;
}
// result: JSON
var searchResult = me.Search_Get_SavedSearch_Results({
arguments: undefined /* JSON */,
oid: oid /* STRING */,
CSRF_NONCE: csrf_token /* STRING */,
$select: select /* STRING */
});
var row = {};
for each (var hit in searchResult.items) {
row = hit.attributes;
row.objectId = hit.id;
result.AddRow(row);
}

Re: Creating datashape relevant to saved search table in windchill

First of all can you verify the service you are using me.Search_Get_SavedSearch_Results returns data you expecting?

Re: Creating datashape relevant to saved search table in windchill

This issue is fixed. We created data shape based on the internal ID of windchill data and it started working. Thank you for following it up.

View solution in original post

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum! ______________________________