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:

    • Related Articles

    • Introduction to Document Generator

      What is the document generator? The "Document Generator" allows you to generate documents based on a standard Microsoft Word file filled with SharePoint list data. This can be triggered in actions used in list actions, modern forms or background ...
    • Action: Generate document

      Generate document action allows you to generate documents based on a standard Microsoft Word file filled with SharePoint list data. For more information about Action Builder read Action Builder Introduction article. For more information about ...
    • How to use QR code image in the Document Generator template

      There are a lot of services that generate QR codes. In this article, we use this service to generate QR code image with Send HTTP request action and use this image in the Document Generator template: 1. Add Send HTTP request action with the API ...
    • Action: Break item permission inheritance

      Break item permission inheritance action allows automatically break inheritance permissions for the specified list item/document from their parent (list, document, etc.). Further you can directly assign/add new permission using action Add item ...
    • Action: Stop sharing item

      Stop sharing item action will remove all permissions on the specified item or file except for site owners. Example of configuration on the current site For more information about Action Builder read Action Builder introduction article. To configure ...