Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Solved! Go to Solution.
You can use the SearchModelTagTerm service to find it.
var params = {
maxItems: undefined /* NUMBER */,
types: {"items": ["Group"]} /* the type of item you're looking for */,
names: { "items": ["TW"] } /* change to your Vocabulary name */,
term: "Demo" /* change to your Term */
};
// result: INFOTABLE dataShape: EntityDescriptor
var result = Resources["SearchFunctions"].SearchModelTagTerm(params);
For this example, I had previously tagged a User Group with the "TW:Demo" tag (TW is the Vocabulary and Demo is the Term) and this code returned that item. (For a list of all the options for Types, check out this forum post.)
Note, though, that if the term exists it also returns as the first row "TW~ModelTagVocabulary". I found mention of this as a bug, but am unsure of the status of it. In my code I've worked around it by skipping if the ID is "TW~ModelTagVocabulary".
You can use the SearchModelTagTerm service to find it.
var params = {
maxItems: undefined /* NUMBER */,
types: {"items": ["Group"]} /* the type of item you're looking for */,
names: { "items": ["TW"] } /* change to your Vocabulary name */,
term: "Demo" /* change to your Term */
};
// result: INFOTABLE dataShape: EntityDescriptor
var result = Resources["SearchFunctions"].SearchModelTagTerm(params);
For this example, I had previously tagged a User Group with the "TW:Demo" tag (TW is the Vocabulary and Demo is the Term) and this code returned that item. (For a list of all the options for Types, check out this forum post.)
Note, though, that if the term exists it also returns as the first row "TW~ModelTagVocabulary". I found mention of this as a bug, but am unsure of the status of it. In my code I've worked around it by skipping if the ID is "TW~ModelTagVocabulary".