Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
I have a list of entities prepared in an infotable. Looks like "Things[entityname].SetTags(params);" this code works only for things but not for media and style definition entities. Please help.
try
{
var selectedTags = INFOTABLE; \\(list of entities);
var tableLength = selectedTags.rows.length;
for (var x = 0; x < tableLength; x++) {
var row = selectedTags.rows[x];
var tags = new Array();
var params = {
tags: "TagName:Voc"
};
var entityname = row.name;
Things[entityname].SetTags(params);
}
}
catch(err) {
logger.error("Error @ Thing -"+me.name+", Myservice, @ line " + err.lineNumber + ": " + err);
}
Solved! Go to Solution.
Hello @DM_9985019 ,
I personally haven't tried this, but for Media entity and Style Definition, can you please below two:
MediaEntities[entityname].SetTags(params);
and
StyleDefinitions[entityname].SetTags(params);
Thanks,
Shirish
Media entities most likely (I haven't tried) do not support services, so to get tags on a Media entity, you probably need to rewrite the full definition.
I don't recall there to be a specific service to just add tags to a Media entity.
Hello @DM_9985019 ,
I personally haven't tried this, but for Media entity and Style Definition, can you please below two:
MediaEntities[entityname].SetTags(params);
and
StyleDefinitions[entityname].SetTags(params);
Thanks,
Shirish
Hi @DM_9985019.
If either of the previous responses allowed you to find a solution, please mark the appropriate one as the Accepted Solution for the benefit of others with the same question.
Regards.
--Sharon