Rajdeep Ganguly
Mega Guru


In ServiceNow Workspace (SOW), the traditional client-side scripting methods like g_form, g_user, etc. are not supported. Instead, ServiceNow has introduced a new client-side scripting API called 'now-*' components.

To replicate the functionality of the button in SOW, you can use the 'now-button' component. Here are the steps:

1. Create a new UI Action with the following properties:
- Name: Set Values
- Action name: set_values
- Client callable: true
- Script:

function() {
g_form.setValue('service_offering', result[2]);
g_form.clearMessages();
}


2. In your Workspace view, add a new 'now-button' component with the following properties:
- Label: Click Here
- Action: set_values

3. The 'now-button' component will call the 'set_values' UI Action when clicked, replicating the functionality of the button in the platform view.

Please note that the 'now-*' components are only available in the New York release and later. If you are on an earlier release, you will need to upgrade to use these components.


nowKB.com

For asking ServiceNow-related questions try this :
For a better and more optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.
Link - https://nowgpt.ai/

For the ServiceNow Certified System Administrator exams try this :
https://www.udemy.com/course/servicenow-csa-admin-certification-exam-2023/?couponCode=NOW-DEVELOPER