Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hi community,
I would like to ask that if anyone knows that how to iterate over the application keys which are existed in the platform without knowing anything like list of Application keys. Please let me know about it
for eg like GetKeyID(), GetExpirationDate(), ...
Thanks!
Solved! Go to Solution.
thank you! i also found out one solution
var params = {
tag: undefined ,
nameMask: undefined ,
type: "ApplicationKey" ,
maxItems: 500
};
var result = Resources["EntityServices"].GetEntityList(params);
//select output as an infotable
Here you go:
Resources["SearchFunctions"].SearchModelEntities({
types: {"items": ["ApplicationKey"]}
}).rows.toArray().map(row => row.name).forEach(key => {
let entity = ApplicationKeys[key];
logger.debug('AppKey ' + key + ': ' + entity.GetKeyID() + ', expiring on ' + entity.GetExpirationDate());
});
/ Constantine
thank you! i also found out one solution
var params = {
tag: undefined ,
nameMask: undefined ,
type: "ApplicationKey" ,
maxItems: 500
};
var result = Resources["EntityServices"].GetEntityList(params);
//select output as an infotable
Hi @MA8731174 ,
I wanted to follow up with you on your post. Upon further review, we have gone ahead and designated the post we feel successfully answered your question.
In the event that you disagree with the Solution Accepted, please let me know.
Thanks for using the PTC Community!
Regards,
Abhi
@Constantine if we remove the map and use forEach only, wouldn't it have the same effect in this specific situation?
@VladimirRosu you could do this:
Resources["SearchFunctions"].SearchModelEntities({
types: {"items": ["ApplicationKey"]}
}).rows.toArray().forEach(row => {
let entity = ApplicationKeys[row.name];
logger.debug('AppKey ' + row.name + ': ' + entity.GetKeyID() + ', expiring on ' + entity.GetExpirationDate());
});