Skip to main content
pshashipreetham
18-Opal
18-Opal
December 21, 2022
Solved

Get Entities based on Model tags

  • December 21, 2022
  • 1 reply
  • 1391 views

Hi,

I do have a few Entities tagged with the tag Applications: Sprint1; how can I get all the Entities under that Tag in a Service output to have an Info table?

Thanks,

Best answer by Markus_Neini

Hi,

 

there is a Snippet to get an entity list, based on different search criteria. You can use a tag or a nameMask (allows a wildcard search). 

 

let params = {
maxItems: undefined /* NUMBER {"defaultValue":500} */,
nameMask: undefined,//"Test*" /* STRING */,
type: "Thing" /* STRING */, //Mashup,ThingTemplate,ThingShape, ...
tags: "PTC:Navigate" /* TAGS */
};

// result: INFOTABLE dataShape: RootEntityList
let result = Resources["EntityServices"].GetEntityList(params);

 

The result is an Infotable with the DataShape: "RootEntityList". If you want to get mashup, Templates etc in one Infotable, than you can use the snippet for different Types an simply join them with the Union Snippet.

 

let params = {
t1: table1 /* INFOTABLE */,
t2: table2 /* INFOTABLE */
};
let result = Resources["InfoTableFunctions"].Union(params);

 

Markus_Neini_0-1671694982707.png

Best regards
Markus

 

1 reply

12-Amethyst
December 22, 2022

Hi,

 

there is a Snippet to get an entity list, based on different search criteria. You can use a tag or a nameMask (allows a wildcard search). 

 

let params = {
maxItems: undefined /* NUMBER {"defaultValue":500} */,
nameMask: undefined,//"Test*" /* STRING */,
type: "Thing" /* STRING */, //Mashup,ThingTemplate,ThingShape, ...
tags: "PTC:Navigate" /* TAGS */
};

// result: INFOTABLE dataShape: RootEntityList
let result = Resources["EntityServices"].GetEntityList(params);

 

The result is an Infotable with the DataShape: "RootEntityList". If you want to get mashup, Templates etc in one Infotable, than you can use the snippet for different Types an simply join them with the Union Snippet.

 

let params = {
t1: table1 /* INFOTABLE */,
t2: table2 /* INFOTABLE */
};
let result = Resources["InfoTableFunctions"].Union(params);

 

Markus_Neini_0-1671694982707.png

Best regards
Markus