Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Triggering Table level UI action through API call

Gajendra Singh1
ServiceNow Employee

I'm trying to trigger UI action through the Rest API call. How can I trigger UI action present on the Table level and not the record level. Being at the table level, 'sysparm_sys_id' is not available. This is causing the rest call to fail with the below error:

{
"error":{
"message":"A JSONObject text must begin with '{' at character 0 of ",
"detail":"A JSONObject text must begin with '{' at character 0 of "
},
"status":"failure"
}
 
URI - https://xyz.service-now.com/api/now/ui/ui_action/5dcda6a8db588c10219f904bdb961911?sysparm_table=u_cid_configuration_parameters_list&sysparm_sys_id=&api=api
 
body - { "fields": [ { "sys_id": "" } ] }
 
is this even possible to perform it on table-level UI Action?
 
1 REPLY 1

Kurian Thomas P
ServiceNow Employee

Hi @Gajendra Singh1 ,

If its a custom UI action.
why don't you create a script include.
add the code for the ui action as a function.
call that function from the ui action
also use your api to call the same function in the script include 

If it helps do give this a Thumbs up 😄
Cheers