Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
Hi,
LocalizationTables["es"].DeleteToken({
name: "1-Fire Defect Code 38#" /* STRING */
});
Unable to delete token which is in es table using delete token service
This token has been create using service AddorupdateToken on es table.
Error in script logs : Error executing service DeleteToken. Message :: Token [[1-Fire Defect Code 38#]] not found
But this token is present in es table but not in Default table.Please help me with this.
Solved! Go to Solution.
when you add a new token to a non-Default localization from Composer, you are required to set the "Default Token Value". This is because tokens added to non-Default localization are expected to also have a Default value. This is explained in ThingWorx Help Center as below.
However, it seems service AddorupdateToken DOES NOT follow above rule. It has only 2 parameters: token name, token value. If you run this service with non-Default localization, the new token will not have a Default value, either be visible in Default localization.
LocalizationTables["**"].AddOrUpdateToken({
name: "xxx" /* STRING */,
value: "yyy" /* STRING */
});
For such token, you can only delete it with its original localizatoin, not able to delete from Default.
LocalizationTables["**"].DeleteToken({name: "xxx" /* STRING */});
Above actions were all tested with ThingWorx 9.4.0.
If you see different actions or you are using a different version of ThingWorx, please share below to us so we can check deeper.
- thingwrox version
- reproducing steps (including service name, parameter value, screenshots, etc)
try to delete from Default,
LocalizationTables["Default"].DeleteToken({
name: "1-Fire Defect Code 38#" /* STRING */
});
Actually some of the tokens have token value in that language but not in Default langauage.
So those tokens are not existing in Default localization table
when you add a new token to a non-Default localization from Composer, you are required to set the "Default Token Value". This is because tokens added to non-Default localization are expected to also have a Default value. This is explained in ThingWorx Help Center as below.
However, it seems service AddorupdateToken DOES NOT follow above rule. It has only 2 parameters: token name, token value. If you run this service with non-Default localization, the new token will not have a Default value, either be visible in Default localization.
LocalizationTables["**"].AddOrUpdateToken({
name: "xxx" /* STRING */,
value: "yyy" /* STRING */
});
For such token, you can only delete it with its original localizatoin, not able to delete from Default.
LocalizationTables["**"].DeleteToken({name: "xxx" /* STRING */});
Above actions were all tested with ThingWorx 9.4.0.
If you see different actions or you are using a different version of ThingWorx, please share below to us so we can check deeper.
- thingwrox version
- reproducing steps (including service name, parameter value, screenshots, etc)