Link a Survey Response to a Case

Do you want to send a survey to your customer when a case is resolved and have the response linked to the case in CRM? Here is how: First, we will install a custom workflow assembly that will let us get a record’s ID so we can use it in a link. Then we will create the workflow that will send the link to the survey in an email.

NOTE: This is an example that requires using a custom workflow assembly that is not designed by ClickDimensions. Please do not contact ClickDimensions support for implementing this example. If you need assistance, a qualified CRM developer partner can assist you.

1. Download and import the GetRecordId solution. This solution works with CRM Online as well as CRM 2011 on-premise. This sample solution contains a custom workflow activity that we’ll use later. (NOTE: THE CODE INCLUDED IN THIS DOWNLOAD IS PROVIDED AS A SAMPLE ONLY. CLICKDIMENSIONS DOES NOT PROVIDE TECHNICAL SUPPORT FOR THIS SOLUTION. Also, this is not available for CRM 4.0, though there may be other solutions on Codeplex that will do the same thing, or you can refer to the CRM SDK from Microsoft.)

NOTE: This solution does not work for CRM 2013+ on-premise. However, you can find a similar compatible solution at Adxstudio, which can be downloaded here.

Survey to Case - Get Record ID Solution

3. Set the workflow scope to Organization and to start when the case’s record status changes:

Survey to Case - Workflow Settings

4. Add a Check Condition step to the workflow:

Survey to Case - Check Condition

5. Check that the Status Reason of the Case is Problem Solved:

Survey to Case - Status Reason

6. If you successfully imported the custom workflow activity in step 1, you will have an option to add a new custom step to the workflow GetRecordId:

Survey to Case - GetREcordId

Add the GetRecordId step, and in the workflow designer, give it a simple name with no spaces such as GetId:

Survey to Case - GetId

7. Next, add a step to send an email (in this example, it’s a standard CRM email, not a ClickDimensions email):

Survey to Case - Send Email

Survey to Case - Satisfaction Email

Save your workflow. We need to get the URL of our survey before we compose the email.

8. Open the ClickDimensions Survey web content record for your case satisfaction survey, and then click the Design button:

Survey to Case - Survey Design

9. In the Survey designer, click the Embed button to get the link to the survey. Copy the URL of the survey:

Survey to Case - Embed Survey

10. Go back to your workflow and click the Set Properties button to compose the email. Add a hyperlink to the body of the email:

Link survey response to a case 1

Link survey response to a case 2

11. The email body will now look like this:

Link survey response to a case 3

12. Place your cursor just after the link. We are going to modify the link that is sent for the survey by adding two things: first a special parameter and second we will add the Record ID that the custom workflow step has generated.

After the survey link, type: ?p=1&_cld_incid=

Then insert the dynamic value for the RecordID using the workflow’s dynamic values selector:

Link survey response to a case 4

NOTE: Make sure to remove any blank spaces between the link URL and the RecordID placeholder. Blank spaces will make the link break.

13. Now when the case is resolved CRM will send an email with your survey link, and it will have the case ID as a parameter in the URL.

Link survey response to a case 5

14. When the customer completes the survey, the Posted Survey record will automatically be associated with the Case record in CRM.

Link survey response to a case 6

Now you can kick off other workflows, such as an alert when a Posted Survey is associated with a case. Or you can use the same concepts to solve other business problems. The custom workflow activity in step 1 can be used to get any record’s ID in a CRM workflow. For example, you can use this custom workflow step to get a contact’s ID and save it to a custom field on the contact record so you can use it to build links in ClickDimensions Email Templates.