cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Localization token retrieval

KT_10107318
7-Bedrock

Localization token retrieval

Hi all, is there any way to retrieve the token name using the token values

There are multiple entry for token name which has same token value. For

 example ui.testpassed= test passed , also test_passed = test passed. Need to clean up duplicate

Thanks in advance 

ACCEPTED SOLUTION

Accepted Solutions

Not directly.. but you try workaround by...

  • Get all token names and values
  • Iterate or over the tokens
  • Or do aggregate with group by token values
let allTokens = LocalizationTables["<localization table>"].GetTokens();

let params = {
	t: allTokens /* INFOTABLE */,
	columns: 'value' /* STRING */,
	aggregates: 'COUNT' /* STRING */,
	groupByColumns: 'value' /* STRING */
};
let result = Resources["InfoTableFunctions"].Aggregate(params);

View solution in original post

1 REPLY 1

Not directly.. but you try workaround by...

  • Get all token names and values
  • Iterate or over the tokens
  • Or do aggregate with group by token values
let allTokens = LocalizationTables["<localization table>"].GetTokens();

let params = {
	t: allTokens /* INFOTABLE */,
	columns: 'value' /* STRING */,
	aggregates: 'COUNT' /* STRING */,
	groupByColumns: 'value' /* STRING */
};
let result = Resources["InfoTableFunctions"].Aggregate(params);

Announcements


Top Tags