Skip to main content
8-Gravel
October 19, 2022
Solved

Localization token retrieval

  • October 19, 2022
  • 1 reply
  • 875 views

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 

Best answer by Sathishkumar_C

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);

1 reply

17-Peridot
October 20, 2022

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);