Skip to main content
16-Pearl
November 28, 2024
Solved

is it possible to iterate on all Application keys in thingworx without knowing id

  • November 28, 2024
  • 1 reply
  • 957 views

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!

Best answer by MA8731174

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

1 reply

18-Opal
November 28, 2024

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

MA873117416-PearlAuthorAnswer
16-Pearl
November 29, 2024

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

12-Amethyst
December 9, 2024

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