





Transform data with lookup tables in HubSpot automations
To build automations that apply to all company contracts or utilize templates from shared template spaces, you must have user permissions to “Manage all contracts” enabled for your account, be the creator or have shared “Manage templates” permissions in the specific source template space.

Configure the HubSpot automation trigger
To learn how to use a lookup table data to automatically create a new contract draft when a HubSpot deal stage is changed, you must first set up the event that will start the automated process. This requires an established connection to your HubSpot account from the Contractbook integrations page.
Click the Automations tab from the main navigation menu on the left side of the screen.
Click the blue Create new button in the top right corner of the page.
Select Deal stage is changed from the trigger drop-down menu.
Choose the specific Deal stage that will initiate the automation flow (e.g., "Closed Won").
Click the blue Save button to confirm your trigger configuration.

Configure the transform data action
This step explains how to transform data in lookup tables. A lookup table allows you to take raw data from HubSpot and convert it into specific dynamic contract values (e.g., changing a code like "SUB1" into "Subscription 10% off").
Click the Add action button located below your saved trigger.
Search for and select Transform data from the action options.
Use the dropdown menu in the automation configuration, to select Lookup table transform type.
Select the specific custom variables from your HubSpot deal stage using the search bar under the list of Data sets section.
Type a descriptive name in the Label field. This label becomes the new variable you will use in subsequent automation steps.

Use the transformed data to create a draft
Now you can use your newly transformed variable to populate your automatically created contract draft.
Click the Add action button beneath your transform data step.
Search for and select Create a draft.
Select the template you want to base the new contract draft on from your private, shared template spaces or Contractbook's predefined library.
Click into the Document title field under the Details tab (or any other field under the Data, Attachments, Other tab, to map out fields like signee details, data fields, custom messages) and select the label variable you created in the transform data step.
Click the blue Save button to confirm your action.


Publish and test your automation
Before relying on the automation for company workflows, you should activate and test it to ensure the lookup table translates your data correctly.
Type a descriptive name for your workflow in the Automation name field at the top left corner.
Click the blue Publish button in the top right corner to activate the workflow.
Test the flow by moving a HubSpot deal to the stage chosen in the trigger event and filling in the custom property value that matches your lookup table entry.
Click the Notifications bell icon in your Contractbook main navigation to check if the automation run was successful.
Click the link in the notification to open the newly generated draft and verify that the transformed data was fetched and applied correctly.
If your workflow did not trigger successfully and you need to fix a failed automation, expand the failure details in your notifications log. You must unpublish the automation first, edit the settings, and click Publish again once the issue is resolved.
Helpful guides:
