The CreatorCon Call for Content is officially open! Get started here.

Process Automation Designer - Don't Understand How to use Collect User Data Activity

Marc D
Tera Contributor

I have been playing with Playbooks and Process Automation Designer to demonstrate its capabilities, and for the most part, I'm satisfied with what is possible. However, there is one major issue. I have been trying to use the Collect User Data activity, and I cannot for the life of me figure out how it works. No matter which selection I use for the "User form for data collection" field, the Collect User Data activity within any test or actual playbook will always display no input variables, and the only option on the playbook will be to skip the activity.

The official documentation is no help - it is very bare-bones for this specific activity and covers nothing about how to display anything or actually collect inputs.

I would appreciate any explanation on how "Collect User Data" for Process Automation Designer works, with a specific example/screen shot of it working.

28 REPLIES 28

yaronguez
ServiceNow Employee
ServiceNow Employee

I'm sorry this feature is so poorly documented! Updated documentation is on the way that will clarify how to use Collect User Data. Additionally, we're adding a new activity in Xanadu that will let you define these fields directly in Workflow Studio without having to navigate elsewhere.

 

In the meantime, here is the general gist of how Collect User Data works.

 

"Collect User Data" is used to collect arbitrary data that is not stored in a table. Creating a table is the way to go for most data such as customers, products, tasks, etc. But in many cases, it can be overkill. For example, you shouldn't have to create a whole table just to ask a Yes / No question from a Playbook user or to collect a message to send via SMS. In these cases, you would create a Data Definition instead which defines the fields you want to collect. Once you have your Data Definition defined, you can then reference it from the "Collect User Data" activity. The Playbook user will see the fields you specified along with a Submit button. Once they provide the fields and click "Submit" the activity will complete and subsequent activities in the Playbook can reference that collected data.

 

Note, if the data is stored in a table, then you should just use the User Form or Create Record activity instead.

 

Here is how you create a Data Definition:

  1. In the Filter Navigator, search for and click "Data Definitions". This will appear under Playbook Experience as well as Process Automation.
    1. If you don't see this, try navigating to sys_flow_data_definition.list
    2. If you don't have access, then you will need to be a flow designer admin
  2. Create a new Data Definition record, for example, "Text Message".
  3. You'll then see a related list of Flow Data variables for that new Data Definition. By default, the list is blank, but you can add new variables to collect by clicking "New".
  4. For each Flow Data variable you create, specify a Label and Type like any other column at ServiceNow. Some field types will require more details such as "Reference".
  5. Once you've defined all of the Flow Data Variables you wish to collect, return to Workflow Studio / Process Automation Designer and reference that Data Definition in the Collect User Data activity.

Here is our out-of-box email data definition for example:

CleanShot 2024-04-11 at 14.44.42.png

You can even control how these fields will render by creating a Form View over the fields:

  1. While on the Data Definition form, click on the Preview Record icon next to any of the Flow Data variables and copy the virtual table name. It will look like var__m_sys_flow_data_var_XXX.
    CleanShot 2024-04-11 at 14.45.51.png
  2. Paste that virtual table name into your Filter navigator, add the ".do" suffix and hit enter.
    CleanShot 2024-04-11 at 14.46.47.png
  3. This will take you to a new record form on that virtual table.
    yaronguez_0-1712872043821.png

     

  4. Right click the form header and click Configure -> Form Layout.
  5. From here, drag and drop the fields into sections and columns.
    CleanShot 2024-04-11 at 14.47.55.png
  6. These will then be shown to the Playbook user.

I hope this is helpful and I'll set a reminder to add a link to the new documentation once we publish it.

 

Thanks for your patience!

Hi, this is great. Are you able to provide help on how you use this collected data in subsequent activities? what is the dot walk path? I have created a choice and would like to use the choice options to populate resolution notes. I am struggling to connect this choice via dot walk.

Thanks

Jen

If you are using the out-of-box Collect User Data activity definition, you can dot-walk directly to the collected variables using the pill picker. Navigate to Activity -> Outputs -> Flow Data Record -> vars -> and you will see the variables. Unfortunately, you cannot reference these variables in branch conditions. In our upcoming release these outputs will show up directly in the Activity -> Outputs and will be accessible anywhere. If you are not using the Collect User Data activity or you need to access these field values from within the sub-flow, you can run a script to access them. As long as the Sub Flow has access to the Flow Data record, you can access the variables as record.vars.[var_name].  For example, you may have a subsequent activity take in the Flow Data Record as an input to a sub flow, and then extract the first_name variable as fd_data.subflow_inputs.flow_data_record.vars.first_name (assuming the input is called flow_data_record.

Hi Jennifer, as of Washington DC release you can automatically dot-walk to data collected via the Collect User Data activity. In the Xanadu release this activity was replaced with a new Questionnaire activity that lets you define the questions directly in the side panel of the Playbook Designer. These questions are now versioned as well so that you can safely change them without impacting any running Playbooks. They are also included in the Process Definition update set so that you can move a single Process Definition XML file between instances and get all of the questions along with it.

Hi, I have attempted to use Questionnaire, but I run into a problem where the questions are greyed out on playbook run no matter what I try. Is there something that I could be missing?

JenniferDallim_0-1731279333065.png