
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 06-15-2021 04:24 PM
Playbooks are a fantastic toolset available within ServiceNow. It provides the process owners the ability to provide fulfillers written guidance, walking the fulfiller through complicated processes from start to finish improving customer experience & task resolution.
What is Arbitrary Data?
Arbitrary data is information that is relevant to the Playbook, but does not need to be stored in a table like an incident or case. This data when ingested is instead stored on the table sys_flow_data for use in the current flow or playbook.
When to use Arbitrary Data?
Arbitrary Data comes in to play in the following scenarios:
- Data needs to be collected for re-use later in the playbook:
-
- Team A performs an activity, the playbook is assigned to Team B for completion where the data is important for task completion, but not required for storage
- Downstream playbook activities should only be triggered with certain conditions, but the data for that activity does not require storage
In this post we will cover how to build an Activity Definition using arbitrary data to meet the criteria above
Activity Components
Activities consist of 3 units of configuration to enable their use on playbooks which are:
- Data definition
- Subflow
- Activity Definition
Once defined the activity can be added to the playbook in Process Automation Designer(PAD). Once added the activity can then be referred to as an 'Activity Instance'. This is because once an Activity has been placed a snapshot of it is taken. To apply further updates the Activity Instance must be removed and the Activity re-added.
Building an Activity Definition with Arbitrary Data
This article assumes you have an understanding of building a Playbook in Process Automation Designer. Information on building a Playbook can be found here. I find the related article on Lanes and Activities particularly helpful when structuring your process within PAD.
To build an Activity which leverages arbitrary data, 3 items will be configured;
Data Definition
A data definition needs to be created on the table sys_flow_data_definition. Open the table and create a new record. Once saved a related list named 'Flow Data Variables' will show similar to the variables while creating a catalog item, use this to create the variables requiring user input.
Setting mandatory here is possible by personalising the relate list and adding the mandatory column.
Subflow
The subflow will determine the behaviour of the activity, determining which data definition to use and the inputs & outputs required. Defining these in the subflow will provide:
Inputs
For Inputs we define the following:
- ServiceNow recommends setting the Assignment Group and Assigned To. This allows greater control over who can update the Playbook activity when active.
- Enhanced automation and display options such as waiting for user input, or displaying the outputs of precursory Playbook activity in the message of the current activity.
- Inputs defined will allow the flow to receive data dynamicallly from the playbook, using the pill picker. This will be covered at the end. For now ensure that the following is defined as a minimum
Outputs
- Allows use of data in subsequent Playbook activities as condition triggers or to be displayed in messages
- Select boxes should have their choices defined in the subflow as well to prevent interface difficulties when using the activity in a Playbook
Subflow
- Which data definition will be displayed to the user for capture of variables. Data definitions captured via an active playbook will be visible in the table sys_flow_data
Building the subflow
- Open flow designer and create a subflow
- Define the subflow inputs & outputs
- Define the following activities:
-
- Action - Create Flow Data
-
- Set the Data Definition to the one you created
- Set 'Wait for user input' to No. We do not want the activity to pause before it loads the variables for the user
- Set the Assigned To & Assignment Group to the previously defined inputs
- Action - Wait for Condition
-
- This will tell the flow to pause until the user has submitted the Playbook activity
- Set the wait for condition to use the record created by the first action on the subflow
- Set the conditions to wait for the record state to 'Complete'
- Flow Logic - Assign Subflow Outputs
-
- For each output required assign a scripted subflow output where the script sets the field created on table sys_flow_data to the subflow output, using the code: return fd_data._1__create_flow_data.record.vars["data_definition_variable_name"];
- By also defining an output called 'Record', trigger conditions in subsequent Playbook activities can be defined on the records state
Activity Definition
The Activity Definition is built to allow process owners to leverage the configuration in Process Automation Designer. We can use a shortcut here to help expedite its creation by finding a similar activity.
Activity Creation
- In Process Automation > Activity Definitions either create a new activity or duplicate an existing activity.
- Set the Description, this field determines the information displayed to the process owner in PAD and leverages HTML
Tab: Automation Plan
- In Automation Plan set the flow to the subflow previously created and save the records.
-
- New fields will now display, these are the subflow inputs and can be set here or left blank as they will be available in PAD.
- In the related list add the required playbook actions. If this is not entered the playbook activity will not correctly render the fields defined in the Data Definition
Tab: Activity Experience
- Set the experience type to an existing one or create a new experience type. This determines several of the options available in Activity Experience. To start off use the out of the box experience type: Record
- In Associated record the behaviour of the playbook activity is defined. This defines the record in use and allows PAD visibility of an active playbook activities completion
- Locate the description field and using the data pill picker set it to use the subflow input 'Message'
- Set details as required. The field 'Form View' if used directly references a view defined on the corresponding sys_flow_data, or if a different associated record was defined a view on the table in use.
Input Display Preferences
Input Display Preferences must be defined when using inputs such as message. This field can be added to the form but there is currently a Client Script for validation which has a habit of removing inputs on custom activities. The client script could be turned off but to prevent customisation yet enable the feature:
- Navigate back to list view and personalise, adding the field Input Display Preferences
- Add the data 'message=standard;'
The Activity Definition is now complete! It is now ready for use in Process Automation Designer. If you already have PAD open the page will need to be refreshed.
Result
By defining the description the activities can provide information for Process Owners when building their playbooks
By placing the activity in PAD an instance of the activity has been created.
Configure the Activity Instance and adjust options on the definition which are also available, adjustments can be considered an override which do not change the source Activity Definition.
By defining the Assignment Group and Assigned To here, the process owner has greater control over who is able to complete the activities which is especially useful when a task has been re-assigned during the process.
Set the message here. Using the data pill picker we can see outputs from previous activities and use them in the text displayed on the Playbook Activity. The same outputs can also be referenced when defining Activity Instance Trigger Conditions.
Complete building your process as required. As the message has been defined as an input you will only need additional Activity Definitions when different variables are required, or alternate subflow behaviour.
By defining these you will provide your fulfillers with a playbook which:
- Leverages flow logic enabled by the outputs of previous activities
- Is able to display outputs of previous activities in a playbook activity text, reducing the need to look at historical activities
- Does not unnecessarily store data in custom tables
Credits:
Personally I'd like to thank Jonathan Jones and Yaron Guez from ServiceNow who provided key knowledge, allowing my team and I to leverage Playbooks using variables as opposed to tables.
- 15,258 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi! Thanks for this post, it helped me a lot.
I was wondering if it is possible to have two fields in a custom Collect User Data, and hide/show the second one depending on the value of the first one?
In the activity above, I would like to hide or show the 'raison_2' field depending on the selected option in the 'Decision' field. I began to create a UI Policy but is it not clear for me how I would access the 'Decision' field and value in the Condition of the policy:
For now, my workaround is to move the 'raison_2' field to another custom Collect Data activity and make this activity run conditionally, depending on the output of the first activity (value of 'Decision' field.)
I'm open to suggestions! Thanks for your help!

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Sorry for the delayed response Martin. UI policies at this point in time are not supported on this type of playbook activity. Activities which have an underlying table do support UI policies - if this is more suitable you may find that one of the OOTB playbook activities can be used.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Ok I understand, thanks again for the help!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi, this is such an amazing article and props to you for figuring this out!
I followed your article and I think I got everything correct, but I am unable to enter inputs on my activity.
My Input Display Preferences is currently -
"assignment_group=standard;assigned_to=standard;message=standard;"
Here is a screenshot of a Playbook in progress.
Do you think I missed something obvious?

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi,
There's a client script called 'Save input display preferences' which operates onSubmit.
To maintain OOTB configuration the client script should remain active.
To workaround the client script - Input Display preferences need to be set using the list view of Activity Definitions. If you subsequently open the Activity Definition and update it the client script will remove the display preferences you had previously set via list view - they will need to be reapplied in the same method.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
EDITED:
Thank you for the response!
In short, did you mean that the Input Display Preferences of this custom activity should only be "message=standard;" and not "assignment_group=standard;assigned_to=standard;message=standard;" ?
Also, even though I tried changing both options, I still do not get the option to input data.
I am guessing my Playbook Action configurations aren't quite right. Are you able to share how to create the correct Playbook Actions? My Action needs to have an input that is is a simple dropdown with 2 options.

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
For input display preferences I only use message=standard. Assignment group & assigned to can be set on the activity instance once placed on your process in Process Automation Designer.
The actions you add to your activity need to be inline with the type of record youre using. So far the OOTB actions have been met the requirements of what I need but when I use a case type selection of an action whose 'Playbook Experience' is 'CSM Playbook Experience'. For incident/request I use 'Global Playbook Experience'. Also if not being done already, after each change to your activity definition you will need to remove the activity from the playbook in process automation designer and re-add it.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
ETA-Solved! The client had customized the OOB 'collect_data' vie! I created a custom view and added that to the Activity! I followed your process and it was super helpful!
I was able to get this work on my PDI, however, I am getting a couple of extra fields on the actual client instance that I need to configure.
As you can see, there is a section on my Custom Activity that has a section called "Flow Data". How can I hide this? I can't seem to find any information.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Have you found a way to make a custom input field mandatory?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
You can make the input fields mandatory, but you have to do a step to make the option visible. Afer you create the Data Definition (sys_flow_data_definition table) and add your custom variables, modify the settings for the related list to show the "mandatory" field. Once it is visible, then you can double click the value directly in the variables list to set the "mandatory" field to "true."
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
thank you!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi, this is a great write up, and I appreciate you taking the time to provide this to us!
Quick question, Is there a way to report on the arbitrary variables? For example, I built this out on the case [sn_customerservice_case] table, and am not seeing a way to access these variables while trying to create a report. Is there some way to report on it that's similar to how we can report on catalog item variables?
Any advise is much appreciated!

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Nathan,
Unfortunately there is no easy way to report on the data here, I would actually recommend against reporting on what is stored in the tables.
When reporting is required my company will often build a supporting table and load any prefilled data into it. We can then use the OOTB features to drive any data entry required.
Alternatively for existing flows what you could do is create an automated action to put all of the data into a reporting table either during or at the end of the playbook - not the prettiest solution but it gets the job done.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thank you for this very informative post.
Is a custom activity the only way to access the arbitrary data captured by the OOB "Collect User Data" activity? I feel like the description in the official Docs implies that you should be able to access these values in PAD without having to created a custom activity. Is there not a corresponding OOB activity that allows you to access these values?
"Pause the process and prompt the end user to enter data for use later in the process."
"These outputs can provide data to other activities in your process. You can access this data as activity inputs when you configure your activity"
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Snowdev!
Would you be able to please share how you solved your issue? I am facing the same problem - I am unable to enter inputs on my activity.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Magda, I followed instructions on a lab over here and that is how I remember fixing it. Also, know that PAD is very buggy at times, so start fresh if you are following this lab.
Let me know if you have questions.
https://nowlearning.service-now.com/lxp?id=learning_course_prev&course_id=29c67c9a1bfbe010a5e699b1b24bcb83
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi snowdev,
Thank you for the reply and the link to the lab! Much appreciated 🙂
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hello Zachary,
Thank you for the great tutorial, it's really helpful.
I have a question - Do I need to create a new separate Data Definition, Subflow and Activity Definition for each new set of new variables? In one Playbook I will need to use several custom messages with its own variables and I am just wondering if there is a way to use the same Data Definition for each of them and just control which variables appear each time.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
In case it helps, I managed to collect arbitrary data from users by using Decision Trees.
And I found Recommended Actions much easier to define and configure on top of Decision Trees than Playbooks.