Trigger Survey from a Flow

Vernon1
Tera Contributor

I'm unable to use the OOB Trigger Condition to create and send a survey to a user because the instance uses a couple of custom text fields to capture the name and email. I would love to change this but that's a different story.

 

Has anyone used a Flow to trigger a survey and email to the user? Can it be done?

2 REPLIES 2

BharathChintala
Mega Sage

@Vernon1  yes we can do both from Flow

 

to trigger email trigger a event in flow script and in email notification trigger should be event is fired

Generating Events

There are two ways to generate events:

  • Server-side script using the gs.eventQueue() method
  • Workflow Create Event activity

gs.eventQueue() Method

The eventQueue() method is part of the GlideSystem server-side API. The eventQueue() method inserts an event in an event queue. The eventQueue() method is typically passed four parameters but can also take an optional 5th parameter:

  1. Event name. Enclose the event name in quotes.
  2. GlideRecord object, typically current but can be any GlideRecord object from the event's table.
  3. Any value that resolves to a string. This is known as parm1 (Parameter 1). Can be a string, variable that resolves to a string, or method that resolves to a string.
  4. Any value that resolves to a string. This is known as parm2 (Parameter 2). Can be a string, variable that resolves to a string, or method that resolves to a string.
  5. (Optional) Name of the queue to manage the event.

example:

gs.eventQueue('event.name', GlideRecord, parm1, parm2); // standard form

gs.eventQueue('x_58872_needit.overdueNeedItTask',current,current.number,gs.getUserName());

 

To trigger survey go to survey in related lists open trigger conditions

give work notes changes and work notes contain "This is to trigger survey only from Flow".

 

In flow when you want to trigger survey in that action update work notes with above.

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

Thanks for responding to my post.

Regarding the trigger condition, I do not get the option of "Work Notes contains". My only option is "Work Notes changes".  Is there something I'm missing?

Vernon1_0-1678462498789.png