Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hello,
Basically the title says it all. I have things with identifiers, which are different from their names. Is there a way to find a thing by its identifier? QueryImplementingThings with the query filter on "identifier" doesn't seem to work.
Regards,
Constantine
QueryImplementingThings does not return identifier as one of the column.
You might have loop through each thing to find the corresponding identifier.
There may be a better way too.
That's what I'm currently doing, but it's ugly and inefficient.
Hello, you can do that with QueryImplementingThingsWithData. The query filter will work.
Did you try it? This query returns empty result for me, although I have a thing with identifier 12345:
ThingTemplates[“MyAssetTemplate”].QueryImplementingThingsWithData(
{ query: { "filters": { "fieldName": "identifier", "type": "EQ", "value": "12345" } } }
);
/ Constantine
I copied your code and change the ThingTemplate name and the fieldName. It works for me.
The problem is specifically with the identifier, it's a standard field, just like name or description. This query works with other (custom) fields, it doesn't work specifically with identifiers.
Okey I see. It's weird. The query works though with other standard fields like "name" or "description".
Yes, that's exactly the problem. I also opened a case with PTC Tech Support to see if they can help.