{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":20575,"path":"integrate-applications/create-button-att-config-rpa.md","title":"Invoke Embedded Task Automation via API in RPA Hub","bundle":null,"doc_type":null,"release":"australia","body":"\n# Invoke Embedded Task Automation via API in RPA Hub\n\nInvoke an attended bot process \\(attended automation\\) from the UI experiences by creating an action.\n\nThe limitation to trigger the attended bot process \\(attended automation\\) from other UI experiences such as playbook can be resolved by performing the following customisation. By default, the UI action is created for classic or workspace experience to trigger the attended bot process \\(attended automation\\) when attended configuration is activated.\n\nTo create a UI action or edit an existing one, see [Create a UI action](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-administration/t_EditingAUIAction.md).\n\nIn the corresponding action, verify that the action visibility is `new sn_rpa_fdn.RPAInstanceFormHooks().canTriggerAutomation(current,’<attended_config_sys_id>`.\n\nPopulate the &lt;`attended_config_sys_id`&gt; with the associated Attended Configuration Sys ID.​\n\nThe following code must be added to the **Script** section of the corresponding Action form:\n\n```\nvar rpaFormHooks = new GlideAjax('sn_rpa_fdn.RPAInstanceFormHooks');​\n\nrpaFormHooks.addParam('sysparm_name', 'generateRuntimeLaunchUrl');​\n\nrpaFormHooks.addParam('attendedConfigId’, ‘<attended_config_sys_id>’);​\n\nrpaFormHooks.addParam('recordId', g_form.getUniqueValue());​\n\nrpaFormHooks.getXMLAnswer(function(response) {​\n\nvar result = JSON.parse(response);​\n\nif (!result.error) ​\n\ntop.window.open(result.url);​\n\n});​\n```\n\n**Parent Topic:**[Embedded Task Automation \\(ETA\\) in RPA Hub](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/embedded-task-auto-rpa.md)\n\n**Related topics**  \n\n\n[Embedded Task Automation \\(ETA\\) in RPA Hub](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/embedded-task-auto-rpa.md)\n\n[Conditions for the visibility of UI action \\(button\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/visibility-cond-button-rpa.md)\n\n"}}