How to handle the lookup columns threshold in a Document Generator template for a single item

How to handle the lookup columns threshold in a Document Generator template for a single item

f your Document Generator Template contains more than 12 lookups that exceeds the SharePoint lookup column threshold, you may face the situation that the generated document may not include all lookup values. To overcome this problem we propose the following workaround steps:

In the meantime Variables from Action Builder are supported as well in Document Generation (Teamsware Studio Updaten 16.03.2023) which could be used instead of window variables. See Document Generator intoduction.

1. Add an Execute Script action before the Generate Document action to set values for all lookups you need in the global variables and then use it in the template:






window.dgLookups = {
"Lookup1": [[Lookup1.Value]],
"Lookup2": [[Lookup2.Value]],
....
"LookupN": [[LookupN.Value]]
};

2. Use these variables in the template. Your lookup placeholders in the Generate document template should look like this:
[[=window.dgLookups.Lookup1]]

3. If needed, you can clean up the variables after the document is generated using the Execute Script action after the Generate Document action.
You can find an example in the appendix below. Simply import these .json files into the Action Builder using the Export/Import button in the top right-hand corner: