Examples to use different types of queries with multiple filter criteria

Scenario 3:  

1 – Using 2 different filter criteria  

Combining Filter Criteria:  

Filter Criteria Variations: Filter criteria can be combined in different ways to suit your specific requirements. These combinations may include Dynamic and Static (Vice-Versa), Static and Static, Dynamic and Dynamic, Dynamic and Dynamic or Static, Static and Dynamic or Static, etc. offering versatile options for data management.  

Example 1 – Dynamic and Static:

In the following example; 

Name= ‘[getName]’ AND Type=’Prospect’ 

The first filter criterion (‘Name‘) is Dynamic, denoted by square brackets, while the second criterion (‘Type‘) is Static. This combination allows for precise data filtering.   

For a record to be successfully retrieved and attached to an email, both specified criteria must be met. In other words, the conditions set by both the dynamic and static filter criteria must be satisfied to ensure accurate data retrieval and seamless email integration.   

Example 2 – Dynamic, Static, and Dynamic:

In the second example,  

‘Name = ‘[getName]’ AND Type = ‘Prospect’ OR AccountNumber = ‘[AccountNumber]’  

The first filter criterion (‘Name‘) is Dynamic, the second (‘Type‘) is Static, and the third (‘AccountNumber‘) is Dynamic. This versatile combination ensures a comprehensive approach to data filtering.  

In this scenario, a record is retrieved and subsequently attached to an email when the following criteria are met:  

  • The Name field must be fulfilled.  
  • In addition to Name, fulfillment of either the Type or AccountNumber is also required.  

This dual requirement ensures that the record is accurately fetched and linked to the appropriate email.  

These combinations empower you to refine your data selection with a mix of static and dynamic criteria, tailoring your approach to your unique requirements.   

2 – Using static and dynamic filter criteria  

Static Method:  

In the static approach, the filter criteria are as shown previously.  

Dynamic Method:  

In the dynamic approach, field parsers are introduced in the filter criteria, along with specifying the type of record needed.  

For example, you can include criteria such as:  

AccountNumber='[AccountNumber]’  

Here, ‘AccountNumber’ serves as the field API, while ‘[AccountNumber]’ functions as the field parser. This dynamic field parser retrieves records based on the account number value and attaches them to the email accordingly.  

Name = ‘[Name]’  

In this case, ‘Name‘ is the field API, and ‘[Name]’ is the dynamic field parser. It retrieves records according to the account name value and attaches them to the email.  

For example, if the field parser name value is ‘Mohit,’ it will retrieve all records with this name and attach them to the email. Subsequently, these records can be found in the Salesforce CRM, along with the email and the attached records.  

Example – Static and Dynamic:  

In the following example; 

Name= ‘getName’ AND Type='[Prospect]’ 

The first filter criterion (‘Name’) is Static, while the second criterion (‘Type’) is Dynamic, denoted by square brackets. 

For a record to be successfully retrieved and attached to an email, both specified criteria must be met. In other words, the conditions set by both the static and dynamic filter criteria must be satisfied to ensure accurate data retrieval and seamless email integration.   

Steps to Attach Records with Different Queries Using Email Parser Actions: 

1) Access Email Parser Actions:  

Initiate the process by clicking on ‘New’ within the Email Parser Actions section.  

2) Create a New Action:  

Provide a descriptive name for the action, such as ‘Query Based on Field Parser with Different Filters’.  

3) Specify the Action Type:  

In the ‘Type’ section, select ‘Attach To Record’ as the intended action type.  

4) Select Object Type:  

Within the action settings, choose the relevant ‘Object Type.’ For this example, select ‘Account.’  

5) Sequence Number: 

Next, you need to write a sequence according to your email parser action. 

6) Save Attachment Checkbox: 

The “Save attachment” checkbox should be checked because if it’s not, then attachments will not be included with the record, you will only get the email without any records attached. 

7) Define the First Filter Criteria:  

Set the ‘Filter Criteria’ for the first query. For instance, you can specify Type=’Prospect’ AND Name='[Name]’. This configuration will help retrieve records based on the selected filters.  

Note: We need to follow Steps 1 to 7 again before defining a new filter. 

8) Define the Second Filter Criteria:  

Continue to configure the action by setting the ‘Filter Criteria’ for the second query. For example: Name='[Name]’ AND AccountNumber='[AccountNumber]’. This enables the retrieval of records according to these specific filters.  

9) Save Your Configuration:  

Once you have configured both sets of filter criteria, click the ‘Save’ button to preserve your settings.  

By following these steps, you can effectively set up Email Parser Actions with different filter queries, allowing you to attach records to your emails based on your specific criteria.