- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 01:33 PM
Hi, good afternoon!
I'm studying about widget and communication between: Server, Client and HTML.
in the documentation, says:
"input variable is a data object sent from the client script, this variable is undefined when first initialized"
in short, "input" would be the user's access to information from the Server or Database?
According to the attached image, the user initiates the interaction with the server through ng-click, then an "action" is created so that in the sequence the "input" occurs, then the information is transferred from the Server to the Client and finally to the HTML? Is this correct?
Thank you very much.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 06:45 PM
Hi Elton2,
Regarding "Input", lets say input is the object for user to interact with UI and transfer user's input to server side.
This is one of the use cases that we can implement. There are many more approaches we can do.
HTLM
<button ng-click="c.doSth()">Click the button</button>
Client
c.doSth = function() {
c.data.action = 'do_sth'; // This will transfer to input in server side
c.data.param1 = 'param1'; // This will transfer to input in server side
c.data.server.update(); // Trigger server side update
}
Server Side
if (input && input.action == 'do_sth') {
var param1 = c.input.param1;
// Update server side
var rec = new GlideRecord()
xxxx
xxxx
}
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Cuong Phan
Senior Consultant.
Cuong Phan
ServiceNow Technical Lead

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 06:45 PM
Hi Elton2,
Regarding "Input", lets say input is the object for user to interact with UI and transfer user's input to server side.
This is one of the use cases that we can implement. There are many more approaches we can do.
HTLM
<button ng-click="c.doSth()">Click the button</button>
Client
c.doSth = function() {
c.data.action = 'do_sth'; // This will transfer to input in server side
c.data.param1 = 'param1'; // This will transfer to input in server side
c.data.server.update(); // Trigger server side update
}
Server Side
if (input && input.action == 'do_sth') {
var param1 = c.input.param1;
// Update server side
var rec = new GlideRecord()
xxxx
xxxx
}
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Cuong Phan
Senior Consultant.
Cuong Phan
ServiceNow Technical Lead
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2023 04:00 AM
Hi @Cuong Phan , how are you?
I appreciated your explanation, thank you for your attention support.
Thanks again! 😃