We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Questionnaire activity - default value?

SNNoob
Kilo Guru

Hi!

 

I'm building a Playbook and one of the activities I want to use is the Questionnaire activity. In it, one of the questions is a Reference type, to cmdb_ci table.

 

Can we set default values to these types of fields? Ideally, I would want it to prepolutate with CI value from the record the playbook is associated to, which in this case is Case. In Playbook Designer, there is not a way to set it.

 

If in backend I navigate to this particular question record, stored in sys_flow_data_var table, there is the Default Value tab there but using current. Etc. has not worked.

 

Other ideas or is this just impossible?

1 REPLY 1

surajsengar
Tera Expert

Setting default values in Playbook Questionnaire activities—specifically for Reference fields—is a common hurdle because the Questionnaire engine doesn't "listen" to standard Dictionary default values or Client Scripts in the same way a standard form does.

​Since current isn't working in the sys_flow_data_var table (as that record isn't technically "aware" of your specific Case record during the definition phase), here are the most effective ways to solve this.

​1. The "Data Pill" Mapping (Recommended)

​The most modern way to handle this in the Playbook Designer is to ensure you are using the Inputs of the Questionnaire activity.

​Open your Playbook in the Playbook Designer.

​Select the Questionnaire activity.

​In the configuration pane, look for the input variables for that questionnaire.

​Instead of hardcoding a value, use the Data Pill Picker (the ⊕ icon).  

​Navigate to Trigger -> Case Record -> Configuration Item.

​Note: This requires that the Questionnaire activity was built to accept an input for that specific question. If you are using a pre-defined assessment/survey, you may need to map the "Instance" or "Context" variables.

​2. The Decision Table Approach

​If the default value needs to be dynamic (e.g., "If Case Type is X, default CI to Y"), you should use a Decision Table.

​In your Flow/Playbook, add a "Make a Decision" step before the Questionnaire.

​Pass the output of that decision into the Questionnaire's reference field input.

​3. The "Back-End" Workaround (sys_complex_object)

​If you are determined to use the sys_flow_data_var record, current won't work because the Questionnaire is rendered via the Playbook Experience framework. Instead, you have to use a Scriptable Default.

​Instead of current.cmdb_ci, try using a snippet that pulls from the parent record if the questionnaire is instantiated:

4. Why "current" isn't working

​The sys_flow_data_var record is a definition, not an instance. When the Playbook runs:

​It creates a Context.

​It creates an Activity Instance.

​The Questionnaire renders based on the Variable Definition.

​At the moment the definition is read, current refers to the Variable record itself, not the Case record.