I would like to set up a search on the department field on the search page, which is linked to a reference table.
What is the solution for displaying a specific column here?
I would like to set up a search on the department field on the search page, which is linked to a reference table.
What is the solution for displaying a specific column here?
Hello,
You can automatically translate the reference table by following these steps:
Create a dedicated Groovy script that will retrieve the IDs and values of the rows to be translated and return them as translation keys (i18n).
import com.memority.citadel.shared.api.services.reftable.ReferenceTableDataRow
import com.memority.toolkit.rule.api. ChoicesRuleResult
// Get from refTable snowflake lines with type = silo & parentId = selected environment
// Return there ids as value and displayName as i18ndef fixedChoiceRule = [:]
if(!DIMENSION){
return ChoicesRuleResult.of(“”ui.model.dimension.snowflake“”, [])
}
// Get value of environment dimension
def environment = DIMENSION.sourceDimensions[“”environment“”] as String
// Get from refTable snowflake lines with type = silo & parentId = environment
REF.get(“”snowflake“”).findMatching(“‘type’”, “”Silo“”).findAll {
ReferenceTableDataRow row ->
row.getValue(“”parentId“”) == environment
}.each {
ReferenceTableDataRow row ->
fixedChoiceRule[(row.getValue(“”id“”))] = [“‘name’”: (row.getValue(“”displayName“”))]
}
return ChoicesRuleResult.ofFixed(“”ui.model.dimension.snowflake“”, fixedChoiceRule)Adapt the i18n translations so that these keys are configurable (variabilization), respecting the logic defined in the script.
<i18n:Key id=""ui.model.dimension.snowflake“” readOnly=""false“” system=""false“”>
<translations>
<translation locale=""en“” system=""false“”><![CDATA[{ name }]]></translation>
<translation locale=""fr“” system=""false“”><![CDATA[{ name }]]></translation>
</translations>
</i18n:Key>
After this step, your reference table will appear translated when you use it in features.
Thank you