Using REST API explorer to click on a UI Action on change form

Nitesh Balusu
Giga Guru

Hello Developers,

 

Please let me know how we can use the REST API explorer to and make an inbound rest call where we create a new record and click on a specific UI action on the change form. For example our change form contains UI Actions like Request Approval, Save, Fill out Risk Assessment, Submit etc. 

If I fill out the form and hit on send, the REST call is directly submitting the record, I am unable to figure out how to make it click on any other UI Action.

 

Thanks.

1 ACCEPTED SOLUTION

Jon Barnes
Kilo Sage
You can’t click a ui Action from a rest call. You could use one of these options: 1. Create a business rule that does the same thing as your ui Action, and trigger that with some condition which you will make sure evaluates true while inserting with the rest call. 2. Create a scripted REST API that will take the post of your data, insert the record, then run your custom logic.

View solution in original post

6 REPLIES 6

Jon Barnes
Kilo Sage
You can’t click a ui Action from a rest call. You could use one of these options: 1. Create a business rule that does the same thing as your ui Action, and trigger that with some condition which you will make sure evaluates true while inserting with the rest call. 2. Create a scripted REST API that will take the post of your data, insert the record, then run your custom logic.

Nitesh Balusu
Giga Guru

Thanks

Aleksas Kucins1
Giga Expert

Hi,

I don't think the correctly answer the question. You can call any UI action with REST API or XMLHttpRequest without the need to copy the UI action script to your scripted API. All you need from the UI action is the sys_id.

See link to my blog: https://servicenowthink.wordpress.com/2019/01/07/how-to-call-any-ui-action-with-rest-api-or-ajax-ser...

I have tried your solution above but doesn't work, I get the following error on NewYork version: 

 {"error":{"detail":null,"message":"Requested URI does not represent any resource: /now/ui/sys_ui_action/169ee7fcdb122200a042f278f0b8f58e"},"status":"failure"}