Skip to main content
14-Alexandrite
January 16, 2024
Solved

Set localization table programatically.

  • January 16, 2024
  • 1 reply
  • 1256 views

Hi,

 

1) Is there any way we can create a service to upload tokens to a localization table?

2) Is there a way to manage localization table in a better way instead of adding each token manually?

3) Also how do we use locations inside the service?

Best answer by Bikash_Panda

1. you can use LocalizationTables[<table_name>].AddToken({name: '', value: ''});

2. You can create a UI to manage your tokens.

3. Are you saying how to get a token value in service? You can use one of following services, based on your need,

 

BP_9210462_0-1705409329176.png

 

1 reply

14-Alexandrite
January 16, 2024

1. you can use LocalizationTables[<table_name>].AddToken({name: '', value: ''});

2. You can create a UI to manage your tokens.

3. Are you saying how to get a token value in service? You can use one of following services, based on your need,

 

BP_9210462_0-1705409329176.png

 

14-Alexandrite
January 16, 2024

Thanks for the response.

All the responses are helpful.

 

Is there any documentation where i can get list of all such services, for e.g. some kind of documentation which i can refer and know that i can use something like LocalizationTables[<table_name>].AddToken({name: '', value: ''}); ?

19-Tanzanite
January 17, 2024

Hi @Vimal_Rawat,

Documentation per se is available here: https://support.ptc.com/help/thingworx_hc/javadoc/com/thingworx/resources/localization/RuntimeLocalizationFunctions.html

However typically we don't go there if we try to use those services, simply because the service editor in the ThingWorx Composer gives easy access to the services, in the Snippet section in this case, as @Bikash_Panda shared already. Hovering on them gives the exact explanations in the link above.

However, in addition to the Snippets, you can also choose to see in the "Me/entities" all the services of all the entities in the platform - also for Localization Tables.

These are features of the ThingWorx Composer that were in the platform since the beginning, and are crucial to know and use to have maximum efficiency.

VladimirRosu_0-1705521779423.png