-
Type: Bug
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Directory
A valid id for a hierarchical vocabulary entry is "PARENT_ID/CHILD_ID". However, theĀ Fn.getVocabularyLabel platform function does not recognise this id and returns it verbatim.
Expected Result:
Fn.getVocabularyLabel("country", "europe/France") -> "label.directories.country.France"
Actual Result:
Fn.getVocabularyLabel("country", "europe/France") -> "europe/France"
Workaround:
Split the vocab id by separator, and provide the child id only e.g.
Automation:
var id = input["schema:field"].split("/")[1]; Fn.getVocabularyLabel("country", id); // "label.directories.country.France"
FreeMarker:
<#assign k=Document['schema:field']?split('/')?last />${Fn.getVocabularyLabel('country', k)}
Caveat: need to check the property actually has a value, which creates additional complexity and should be handled automatically by the platform function.