Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Hi ,
I want to get all the projects from a TWX platform excluding PTC's project.
Hi @PP_10477715 ,
If you are expecting to retrieve project list in TWX JS code. Kinldy find the attached code FYR. If not please explain more about your query.
/////******////// To get all project details in TWX code /////******//////
let params = {
maxItems: undefined /* NUMBER {"defaultValue":500} */ ,
nameMask: undefined /* STRING */ ,
type: 'Project' /* STRING */ ,
tags: undefined /* TAGS */
};
// result: INFOTABLE dataShape: RootEntityList
let projectList = Resources["EntityServices"].GetEntityList(params);
/////******////// Remove the project name - PTCDefaultProject from all project list /////******//////
let params1 = {
fieldName: 'name' /* STRING */ ,
t: projectList /* INFOTABLE */ ,
value: 'PTCDefaultProject' /* STRING */
};
// result: INFOTABLE
let result = Resources["InfoTableFunctions"].NEFilter(params1);
Thanks & Regards,
Arun C
Hello,
As i can see in above service first we are fetching all the projects and then we are using filter on that,
So unnecessarily we are loading all the rows, also i have multiple ptc's app deployed on platform and i have to exclude those.
May be we can use the tags, but i don't know how to exclude multiple tags.
one another service is SpotLightSearch, that may be we can use , where we can pass the not expression (the project name not starts with PTC) but i am not sure how we can use that expression.
So unnecessarily we are loading all the rows, also i have multiple ptc's app deployed on platform and i have to
Don't overengineer this. How many projects are on your systems? Even it's 100, if loading those is an issue, you're in trouble.
You can use this to name-filter projects starting with PTC:
let params = { nameMask: "(?!PTC).*", type: 'Project' };
result = Resources["EntityServices"].GetEntityListByRegEx(params);
But this is not guaranteed to filter out all projects coming from PTC. Especially older extensions (e.g. Analytics) might not comply with the naming scheme or use tags.