Here's how to trigger a survey in Wootric based on events and customer data in ServiceNow.

In Wootric

  1. Log in to your Wootric dashboard and go to your Settings. You will see a scroll menu on the left side of your screen. Scroll down to All Integrations > Trigger Surveys. Click into Trigger surveys from ServiceNow.
  2. Scroll to the bottom and click the "enable" button.
  3. Once enabled, you should see the channel Webhook URLs that you will need to set up triggers in ServiceNow.

Creating the REST Message

  1. Log in to your Wootric dashboard and go to your Settings. You will see a scroll menu on the left side of your screen. Scroll down to All Integrations > Trigger Surveys. Click into Trigger surveys from ServiceNow.
  2. Scroll to the bottom and click the "enable" button.
  3. Once enabled, you should see the channel URLs.
  4. In a new browser tab, log in to your ServiceNow account and go to your instance where you want to trigger the surveys.
  5. Using the Filter Navigator, search for REST Message. It's under System Web Services -> Outbound -> REST Message. Click the "New" button to create a new REST Message.

7. Fill the fields with their respective information. In Endpoint paste the URL provided by Wootric to trigger the survey. Once you're finished click "Submit"

8. A new REST Message should appear in the list. Select your newly created REST Message. Scroll down to the HTTP Methods section. Click "New".

Note: For a new REST Message there will be a Default HTTP Method. Instead of a New HTTP Method, you can just edit the default instead.

10. Enter whatever Name you'd like and under HTTP Method select POST.

11. Click on the HTTP Request tab and insert a new row for HTTP Headers. Set Name and Value as shown below.

Name = "content-type" 
Value = "application/json"

12. In Content you need to provide the JSON payload that will be sent from ServiceNow to Wootric. You can find that in Wootric under the ServiceNow triggers page.

With email surveys, you can customize the "subject", "intro", "email_delay" and "survey_settings". The email delay is in minutes. The "survey_settings" is an object that can contain these values:

  • language
  • audience_text
  • product_name
  • custom_messages

custom_messages is also an object that can contain the following values:

  • promoter_followup_text
  • promoter_thank_you_link_text
  • promoter_thank_you_link_url
  • promoter_thank_you_main
  • promoter_prompt_text
  • passive_followup_text
  • passive_thank_you_link_text
  • passive_thank_you_link_url
  • passive_thank_you_main
  • passive_prompt_text
  • detractor_followup_text
  • detractor_thank_you_link_text
  • detractor_thank_you_link_url
  • detractor_thank_you_main
  • detractor_prompt_text

Here's an example using all the parameters.

{
"emails" : "${email}",
"subject" : "This is the email's subject. It can contain values from variables like ${caller_name} or ${incident_id}",
"intro" : "This is an intro message.",
"survey_settings" : {
"language" : "EN",
"product_name" : "Examply",
"audience_text" : "a colleague",
"custom_messages" : {
"promoter_followup_text" : "Thanks for your feedback! Would you please tell us about your experience?",
"promoter_prompt_text" : "What did you like the most?",
"promoter_thank_you_link_text" : "Join our referral program!",
"promoter_thank_you_link_url" : "https://examply.com/referrals",
"promoter_thank_you_main" : "Thanks for your feedback!",
"passive_followup_text" : "Thanks for your feedback. How can we improve?",
"passive_prompt_text" : "Help us improve!",
"passive_thank_you_link_text" : "Return to our Support Center",
"passive_thank_you_link_url" : "https://examply.com/support",
"passive_thank_you_main" : "Thank you for your feedback!",
"detractor_followup_text" : "Thank you for your feedback. How can we improve your experience?",
"detractor_prompt_text" : "Please tell us how we can do better.",
"detractor_thank_you_link_text" : "Return to our Support Center",
"detractor_thank_you_link_url" : "https://examply.com/support",
"detractor_thank_you_main" : "We hear you. Thank you for your feedback!"
}
}
}


You can customize any field by inserting variables like ${caller_name}.

Click "Submit" to create the new HTTP Method. Or Update if it already exists.

14. Go back to your newly create HTTP Method. Under Related Links click on Auto-generate variables. This will generate the variables and they will appear in the Variable Substitutions tab.

15. (For Testing) Now click the Preview Script Usage link and copy the script. You will need it later for Step 5 in the Example Test below.

16. Click Update to save. You're all set up. If you want to test it continue below.

Example Test: How to Use It with Business Rules

1. Now you're ready to use the REST Message where you see fit. For this example, we're going to create an Async Business Rule to trigger the survey after an Incident's state is changed to "Resolved".

2. Use the Filter Navigator and search for Business Rule. It should be under System Definition > Business Rule.

3. Click the "New" button. Input a Name for your Business Rule. Under Table select Incident. Check the Advanced option (this enabled you to use the script you copied from Step 14 above).

4. In the When to run tab select async in When. Check the Update option. In Filter Conditions choose field State Is Resolved.

5. Go the Advanced tab and paste the script from the REST Message under the "// Add your code here" comment (Step 14 above). Remember to replace the generated variables with values from the record (the Incident in this case).

Example:

r.setStringParameterNoEscape('caller_name', current.caller_id.first_name);
r.setStringParameterNoEscape('email', current.caller_id.email);

6. Click "Submit" to create the Business Rule. Test your new Business Rule by changing the State of an Incident to "Resolved".

Did this answer your question?