Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! 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!
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
@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());
});