Variables from Catalog item in Playbook Decision activity
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Community,
I'm looking for some help in playbooks.
We have an item in CSM where there is existing flow will create Ritm and sc_task. But now we are trying to recreate this with Playbook.
Our Workflow will totally work on a variable based on user selection in the option then task will get created).
My Actual query is In Playbook I'm trying to setup the decision activity so I can call this variable and based on the condition I can create a task. But for some reason I don't see variables as such in the option to select in branch condition.
I might be missing something here. Your responses are highly valuable.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Yathvika ,
Step‑by‑step guide for the “mirror variable to RITM field” approach so you can use Playbook Decisions cleanly:
Step 1: Add a field on RITM
- Navigate to RITM table (sc_req_item).
- Create a custom field (e.g., u_selected_option) that will hold the catalog variable value.
- Make it the same type as your variable (string, choice, etc.).
Step 2: Copy variable into the field
You need to ensure that when the RITM is created, the variable value is copied into this field.
Option A: Flow Designer Action
- In your Catalog Item Flow, add an action after RITM creation.
- Use “Update Record” to set u_selected_option = your variable.
- Variables are available in Flow Designer as Trigger → Catalog Variables.
- Map the variable directly to the field.
Option B: Business Rule
- Create a Business Rule on sc_req_item (after insert).
Script to pull variable from sc_item_option_mtom and set the field:
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('sc_item_option_mtom');
gr.addQuery('request_item', current.sys_id);
gr.query();
while (gr.next()) {
if (gr.sc_item_option.item_option_new.name == 'your_variable_name') {
current.u_selected_option = gr.sc_item_option.value;
current.update();
}
}
})(current, previous);
Step 3: Use Playbook Decision
- In your Playbook, add a Decision activity.
- Now you’ll see u_selected_option available in the record fields.
- Define branches like:
- If u_selected_option = "Option A" → Create Task A
- If u_selected_option = "Option B" → Create Task B
Step 4: Create Tasks
- Add Create Task activities under each branch.
- Configure them to generate the right sc_task or other records.
Benefits of this approach
- No custom scripting inside Playbook — all logic is in Flow Designer or BR.
- Audit‑friendly — variable values are visible on the RITM record.
- Reusable — you can branch on the same field in multiple Playbooks.
My recommendation: use Flow Designer mapping (Option A) if possible. It’s cleaner, easier to maintain, and avoids update calls inside BRs.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Best,
Anupam.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @Anupam1
I believe there should be some other way rather than creating a custom field on ritm table, as we cannot create field every time on RITM table for every other requirement and make it messy.
I'm new to Playbooks and was looking for a better approach, we just want to pull the value from RITM variable to playbook as input. So accordingly, I can create the tasks to diff groups in playbook.
Regards,
Ratna Jyothi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
I'm able to get the variables from item as there is a option of input tab in the playbook properties in PDI
But mu customer instance playbooks I cannot see this option, so why I'm unable to pass the variable values into playbook.
Can anyone assist me on this