We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Button Trigger in ServiceNow Workspace

ROCKG
Tera Contributor

I am currently Customizing a new page in ServiceNow workspace. For the i have an button in that Workspace when i click that button i have to trigger that one event in Script Includes.

2 REPLIES 2

Brad Tilton
ServiceNow Employee

You can't directly call a script include from inside UI Builder. You'd need to create a new transform data resource that calls the script include and then execute that data resource from your button.

 

  1. Receiving the Dummy Value: The client sends a request to the server with a dummy value, which is extracted from the request payload.

  2. Updating Records: The ScriptInclude queries the alm_hardware table for records with a state of 1 and a null assigned_to field. It then updates the assigned_to field of each matching record with the provided dummy value.

  3. Returning the Response: After the update process, the system sends a success message back to the client, confirming the update of the alm_hardware table and providing the dummy_value used for the update.