Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Playbooks - update work notes via questionnaire

Mohammedryw
Tera Contributor

I am building a ServiceNow playbook.

The playbook contains several Questionnaire activities that collect information such as:

  • Troubleshooting outcome
  • Details of the checks completed
  • Error message or exception ID
  • Whether the bundle is in Error or stuck in Submitted
  • Other affected users
  • Bundle and case information

I need the answers to be added as a structured entry to the parent Incident’s Work notes after each stage. This is important because the Incident may be reassigned while the playbook is in progress, and the next agent needs to see what has already been completed from the Activity Stream.

I added an Automated Update Record activity after the Questionnaire and selected the parent Incident and its Work notes field. However, the Questionnaire questions or answers do not appear as available data pills, so I cannot map the responses into the Work notes value.

Is there a supported way to expose Questionnaire answers as activity outputs or data pills for an Update Record activity? If not, what is the recommended approach for automatically recording Questionnaire responses in the parent Incident’s Work notes?

2 REPLIES 2

Bhaskar Mantri
Tera Contributor

Hello,

 

Step 1: You can create an action with action inputs as table name and sys_id or type reference to task table and message
Example : Action Name : Custom Update Record
Action Inputs: grItem of type reference, message of type string

 

BhaskarMantri_0-1790022829491.png

Step 2: Add script step
2.1 Define your input variables
Name: grItem , value : select from data pill
Name: work_notes , value : select message from data pill

2.2 We can write own script

Example :
if(!gs.nil(inputs.grItem)) {
inputs.grItem.work_notes = inputs.work_notes;
return inputs.grItem.update();

 

Step 3: In playbook, after Questionnaire, select add activity and click on create new activity

A popup will open to create an activity. You can give lable( example Custom update record activity) and table. Below there is a field under section Automation Plan, Flow or action.
This is a document type field, by clicking magnifying icon, we can select our action created on step 1

Again, select add activity and seach for " example Custom update record activity" create above, there we can pass parent record as input and a message of string type. we can select questionarie values from data pill

 

BhaskarMantri_1-1790023511715.png

 

 

gexe
Kilo Contributor

Hello,

I ran into something similar. It looks like the Questionnaire answers aren’t exposed as normal data pills, so they can’t be mapped directly through an Update Record activity. The approach I’d use is a small custom action/script after the Questionnaire that pulls the responses, formats them into a readable summary, and appends that to the parent Incident’s Work notes. That way each stage leaves a clear record in the Activity Stream for the next agent.