Can we trigger a playbook through ui action new
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2025 01:34 AM
Hi ,
Can we trigger a playbook for creation of a record i.e as soon as i click on ui action new . The playbook should get triggered asking for info and as i submit info and continue . It should create record for me in details in workspace .Kindly let us know how to configure .
Regards,
Veenal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2025 01:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2025 03:10 AM
link shared by @SD_Chandan has the script from ServiceNow docs itself.
please try that and let us know
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2025 08:17 AM
Hi @veenal ,
Add this script in your ui action..
var playbookTrigger = new GlideRecord('playbook_trigger');
playbookTrigger.initialize();
playbookTrigger.playbook = 'sys_id_of_your_playbook'; // Replace with your playbook's sys_id
playbookTrigger.target_table = current.getTableName();
playbookTrigger.target_sys_id = current.sys_id;
playbookTrigger.insert();
Add Playbook to Workspace:
Navigate to All > Workspace Experience > Actions & Components > Related Items.Click New to create a new related item...Set the Table to the same table as your UI Action (e.g., incident).
Action label to something like "Playbook".
Implemented as = UI Component.
Set the Specify UI Component to now playbook experience.
In the Component Attributes tab, set the following attributes:
playbookExperienceId: The sys_id of your playbook.
parentSysId: {{sysId}} (this dynamically references the current record's sys_id).
parentTable: {{table}} (this dynamically references the current record's table).
compactMode: false (set to true if you want a compact view).>> Test the Configuration: Navigate to a record of the table where you added the UI...
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/
