The CreatorCon Call for Content is officially open! Get started here.

Can I execute UI action by UI builder button and How to call an API in UI builder?

susmita2
Kilo Contributor

Hello, I'm new to ServiceNow. Can I execute UI action by clicking on UI builder? and How to call an API in UI builder?

I've created a page on UI builder, on clicking of button it should call http endpoint/third party API and render into UI page. Is this works? Any tutorials or reference will be helpful.

Thanks in advance.

1 REPLY 1

Kopresh
Tera Contributor

Hi,

you can execute UI actions of the form from UI builder. Once you have added glide form data resources to the page, you will get all the fields, ui actions, sections related to that form. 

 

find_real_file.png

 

You can add an UI component called 'Action bar' and bind the UI action data which is received from the glide form data resource.

@data.<data_resource_id>.nowRecordCommonUiactionbar.actionNodes

 

find_real_file.png

 

As far as your second question, you can call table api's from client scrips via helper methods.

helpers.snHttp.

Alternately, you can also call Rest apis and execute them via client scripts.

APi calls from UI builder ( refer -> api.data.<data_resource_id>.execute(Object inputValues))

Please let me know if this helps.