Invoke Embedded Task Automation via API
Invoke an attended bot process (attended automation) from the UI experiences by creating an action.
The limitation to trigger the attended bot process (attended automation) from other UI experiences such as playbook and workspaces can be resolved by performing the following customisation. By default, the UI action is created for classic or Core UI (UI 16) experience to trigger the attended bot process (attended automation) when attended configuration is activated.
To create a UI action or edit an existing one, see Create a UI action.
In the corresponding action, verify that the action visibility is new sn_rpa_fdn.RPAInstanceFormHooks().canTriggerAutomation(current,’<attended_config_sys_id>.
Populate the <attended_config_sys_id> with the associated Attended Configuration Sys ID.
var rpaFormHooks = new GlideAjax('sn_rpa_fdn.RPAInstanceFormHooks');
rpaFormHooks.addParam('sysparm_name', 'generateRuntimeLaunchUrl');
rpaFormHooks.addParam('attendedConfigId’, ‘<attended_config_sys_id>’);
rpaFormHooks.addParam('recordId', g_form.getUniqueValue());
rpaFormHooks.getXMLAnswer(function(response) {
var result = JSON.parse(response);
if (!result.error)
top.window.open(result.url);
});