How to send SMS using a UI action button

Prasad43
Tera Guru

Hello Folks,

We have activated Notify plugin in our servicenow and bought a number from Twilio.

We are using "Send SMS" activity in our alert workflow to notify users.It is working as expected.

Now we have a requirement, We need to have a UI action button on Alert form "Send SMS", When I click on it a 

glide window will be populated, User will enter either user name or Group name. So we want send sms to that user/Group.

I can create a ui page for glide window and take inputs from user. My Question is can we trigger sms using any script.

Can you please assist me to achieve this requirement.

Thanks

prasad

1 ACCEPTED SOLUTION

Prasad43
Tera Guru

I have done this using sendSMS method in Notify API.

var notify = new SNC.Notify();

notify.sendSMS(twilio, userPhone, strMessage);

 

https://docs.servicenow.com/bundle/london-servicenow-platform/page/app-store/dev_portal/API_referenc...

 

Thanks

Prasad K

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron

Hi Prasad,

If you have access to the code for that activity then you can replicate that in your ui page.

Regards

Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Geetanjali Khy2
Mega Guru

Hi Prasad,


Please refer below link, it may be helpful.

https://community.servicenow.com/community?id=community_question&sys_id=ccf383e5dbd8dbc01dcaf3231f9619bc&view_source=searchResult

Please mark correct/Helpful, if it helps you.

Vaibhav
Giga Guru

Hi,

I tried this,

1. You can do this inside a g: evaluate tag. This is where you run the server-side code.

<g:evaluate>

        gs.eventQueue(eventName, GlideRecordObj, parm1, parm2);

</g:evaluate>

or

2. Simply write a client callable Script Inlude to trigger an event from client script of UI page.

Please mark correct/Helpful, if it helps you.

 

Prasad43
Tera Guru

I have done this using sendSMS method in Notify API.

var notify = new SNC.Notify();

notify.sendSMS(twilio, userPhone, strMessage);

 

https://docs.servicenow.com/bundle/london-servicenow-platform/page/app-store/dev_portal/API_referenc...

 

Thanks

Prasad K