If you’ve worked with Dialogs in Dynamics CRM 2011, 2013 or 2015 you have probably seen the option to add a step called “Query CRM Data.” Odds are, you’ve ignored this because you haven’t understood what it is or how it could be used. It’s actually a useful tool for making cleaner, easier to use Dialogs in CRM. Here’s how it works, why and how you might use it.

The Query CRM Data step lets you specify a query to be run on an entity, then allows you to use the set of records returned as options in a dynamic option set in your Dialog. For example, say you create a dialog to quickly create a Phone Call record on an account. You could accomplish this by creating an Account Dialog and simply adding a Contact lookup to find let the user find the recipient. But, the problem is that the lookup is open to all Contacts, not just those associated with the Account. You can use Query CRM Data to narrow down that list into a convenience dropdown of Contacts for that particular Account only.

Here’s how to create a dialog for the example above:

  1. In CRM, navigate to Settings > Processes
  2. Create a new Dialog process for Account with the name “Log Quick Phone Call”
  3. Click Add Step > Query CRM Data and click Set Properties
  4. Look for Contacts, and add the criteria Company, Name Equals, and pick any account (it will be replaced in the next step)
  5. Click the Modify Query Variables tab
  6. Clear the value for Variable1, and insert the dynamic value Opportunity > Account
  7. Click Save and Close
  8. Click Add Step > Page, then Add Step Prompt and Response, then select Phone Call and click Set Properties
  9. Select a Response Type of Option Set and provide values from Query CRM Data
  10. Select the Last Name and First Name columns and enter a the separator as comma-space (, )
  11. Fill in the name and other required fields and click Save and Close
  12. Click Add Step > Create Record and click Set Properties
  13. Insert the dynamic data from the Prompt and Response question into the Recipient field
  14. Fill in other required and default values as desired and click Save and Close
  15.  Click Activate, and try out your new Dialog on an Account!

You can even use a value from a previous prompt and response as a variable in a query to present very dynamic and directed responses in complex Dialogs. Can you think of any other good uses for the Query CRM Data step? Let me know your inventive uses in the comments below.

Like this post? Share it!