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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to get Reference Links for Documents connected to Part

NTailor
4-Participant

How to get Reference Links for Documents connected to Part

Would like to obtain WTDocuments with name "Test Data" from either Reference By or Describe By link from Parts.

 

I was able to use the endpoint getPartsInPartsByID and supply it with value "References" in expand and was able to generate at least the Link OID. But the link oid doesn't offer name of document linked to so would I have to create another service that takes in the link value, gets the doc referenced and get its name? or could this be done in select or via expand parameter?

 

Here is my current service code :

// result: JSON
var partLinks = me.getPartsByID({
$expand: "References" /* STRING */,
ID: ID/* STRING */,
$select: undefined /* STRING */
});
var references = partLinks.References;
var result = "{ \"TestDataIDs\": [";

for ( var i=0; i < references.length ; i++) {
result += "\"" + references[i].ID + "\"";
if (i != (references.length - 1)) {
result += ",";
}
}
result +="]}";

1 REPLY 1
slangley
23-Emerald II
(To:NTailor)

Hi @NTailor.

 

Is your question related to ThingWorx?

 

Regards.

 

--Sharon

Announcements


Top Tags