Skip to main content
12-Amethyst
August 5, 2019
Question

How to Insert Tokens on Localization Table with Service or Rest API

  • August 5, 2019
  • 5 replies
  • 3857 views

Hello everyone;

 

We want to insert multiple Tokens on Localizations Table for certain language ( Turkish - tr  ) . Adding one by one taking is very time consuming. I cannot find any related service which doing this job. 

 

Things I Tried 

 

1 ) After createing new Localization Table, i added a new Token for label. And then i exported the XML file. Opened it a Text Editor and try to duplicate inserted Row Value but i failed. 

 

2) I also tried to monitor the adding token process from Chrome Developper Tool - Network and mimic the process from Postman. it also failed.

 

Addng one by one is doable but its not Efficent way to do. Maybe we need to update some translation on table on future and there is more then 300 entry on the Table. 

 

Can anyone suggest to me any viable option to solve this issue ?

 

Thank you.

5 replies

1-Visitor
August 5, 2019

Here you have the code snippet:

 

 LocalizationTables["LocalizationTableName"].AddOrUpdateToken({
 name: "tokenName" ,
 value: "tokenValue" 
 });
mberber12-AmethystAuthor
12-Amethyst
August 5, 2019

Hello Carles

 

Thank you for your fast reply but the code you had share didn't work. 

 

I am using Thingworx 8.4.3 Version.

 

Thank you.

1-Visitor
August 5, 2019

But didn't worked with no result, you get an error,... You are setting the right Localization Table Name? I can test it on 8.2.x and it do works.

 

Just navigate on Entities and localize the LocalizationTables, there you can see the available services it has.