Import/Export User-Defined Labels
Import/Export through Data Management Framework
We provided several data entities to support import/export scenarios for User-defined labels using the Data management framework. These are:
- Docentric User Defined Labels Groups,
- Docentric User Defined Labels Languages,
- Docentric User Defined Labels,
- Docentric User Defined Labels Translations,
- Docentric User Defined Labels Combined.
The first 4 data entities from the above list can be used for transferring the content of only one related table (Label Groups, Label Languages, Labels, Labels Translations). They need to be used in the same order as listed above, because Translations depend on Labels and Languages, while Labels depend on Labels Groups.
If you plan to additionally modify the data prior to importing it into the target environment, it may be more convenient to use the Excel data format.
If you choose to use Excel, then be careful when adding new Labels and Labels Translations into the exported Excel file. In the data entities where GLOBALLABELID field appears (e.g. @DOC_LABEL:LabelId) you could get the following error: That function isn’t valid.
This error comes from Excel which considers every cell content starting with an '@' character as a function.
To prevent this error, the formatting of Excel column which contains the GLOBALLABELID values should be changed from General to Text:
After you change the formatting for GLOBALLABELID column you will be able to add new Labels and/or Labels Translations without facing the Excel error.
There is one more consideration if you decide to use the Docentric User-defined Labels Combined data entity and to add new labels in Excel before importing. In that case, ensure to match LANGUAGEID and LINENUM values as in already existing Labels. For example, in the image below we already had the InvoiceNumber label, where you can see that the languages have the following LINENUM values assigned:
When we add in Excel a new LABELID with a name NewLabelId, we copy the already existing (range of cells from LANGUAGEID to LINENUM, into the corresponding range for NewLabelId, to make sure that the correct LINENUM for each LANGUAGEID is used. Then we can enter the TRANSLATION text as needed.
Update through Excel Add-In
Besides import/export scenarios, you can use the previously listed data entities to update the labels and their translations in Excel, which you open from the corresponding User-defined label setup forms.
If you choose to update the labels and their translations using Excel Add-In, it might happen that you enter a new Global label ID in a next available cell (see cell A3 below) and get the following error: That function isn’t valid:
This is because you are trying to add new data outside of the cell range linked to the D365FO data (A1 to B2 in the image above). To avoid this error, you can first manually expand the cell range linked to the data:
You can also use the trick with changing the formatting for entire Global label ID column into the Text type: