Back

How to use Query Builder Filters in Maven Documents

Today we would love to expand on the filter's functionality that can help to add conditions to your Query and increase the efficiency of the document generation, speeding it up for you and your users.

Before we do that, let us introduce you to our Documents Mule, who is in charge of the Maven Documents application, ensuring it works smoothly for you.


So what are the Query Builder filters?

Filters allow you to set conditions for the Object query depending on your template use case. Let’s have a look at some examples.

Id equals $recordId

Imagine you want to generate a Sales Quote for a particular Opportunity, which means that you will generate a Quote document for one specific Opportunity at a time.

For a specific Quote, you only need data from a specific Opportunity. You do not want to include information for every Opportunity you have, instead, use the one from which you initiate document generation.

For our Document Mule, it means, that he only needs to get the data for this one Opportunity, and you can help him understand what this Opportunity is (you see, computers can’t live without human help after all).

So when you set a filter Id equals $recordId, Document Mule sets the only destination point on his navigator to be the Opportunity you generate a Quote from, gets there at the speed of light and bring it back to you.

Note: We highly recommend always using Id equals $recordId filter on all the levels of your query when it makes sense for your use case since it prevents you from hitting Salesforce limits and increases the speed of document generation. 

ProductCode starts with “002-”

Imagine you would like to include Products from a specific Product group to be shown in your Quote. You know that based on your data setup, Products of interest contain Product Codes that start with ‘002-’.