CRM Query Groups are a collection of single (not recommended) or multiple queries that can be used in a Call Flow to look up record data in Salesforce allowing the call to be routed based on the results. Having at least two queries in a group provides a failsafe should previous query not return any results.
To create a CRM Query Group, navigate to Denali Workspace > Call Flows > CRM Queries.
Click on the Create CRM Query Group button. This will open the Create CRM Query Group modal.
Enter a Name for your CRM Query Group. In this example, we are using Phone Number Query as the name because we’ll be matching records by Phone Number. When done, click Next.
Variables are what we use to lookup fields from Salesforce, and then return it back to the Call Flow. Since CRM Query Groups are a collection of multiple queries, it’s possible to return different object types each time a CRM Query Group searches for a record. In order to have consistently named data for the Call Flow, CRM Query Groups have Variables which store and align the data that is returned from the assigned record.
Name, ID, and Owner are already populated as Variables by default. Name and ID are required while Owner is optional. (Owner cannot be removed from the Variables tab, but can be removed in Fields to Return)
You can also create your own custom Variable. To create a Variable, click on the Add Variable button.
We advise to name your Variable by the data type you want to return. In this example, we want to use the State for the record in a Call Flow, so we are creating a Variable called State. The State field on a record may be different on a Lead vs. a Contact, but using the Variable that we created for State, we’ll be able to have consistent data in our Call Flow.
Once all Variables are created, click Next to add queries to your group.