SNOW-CSA Self-Service and Automation • Complete Question Bank
Complete SNOW-CSA Self-Service and Automation question bank — all 0 questions with answers and detailed explanations.
Refer to the exhibit.
sys_script_include.js:
var ApprovalHelper = Class.create();
ApprovalHelper.prototype = {
initialize: function() {},
sendApproval: function(rec) {
var user = gs.getUser();
var gr = new GlideRecord('sysapproval_approver');
gr.initialize();
gr.sysapproval = rec.sys_id;
gr.approver = user.getID();
gr.insert();
}
};Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag a concept onto its matching description — or click a concept then click the description.
Server-side logic triggered by record operations
Client-side logic triggered by UI events
Control field visibility, mandatory, and read-only states
Define user permissions on records and fields
Enforce data consistency and validation rules
Drag a concept onto its matching description — or click a concept then click the description.
Insert a new record into a table
Modify an existing record
Retrieve data from a record
Send an email notification
Execute custom server-side script
Refer to the exhibit. The following is an excerpt from a Flow Designer flow that triggers when a catalog item is submitted:
{
"trigger": "Catalog Item Submitted",
"conditions": {
"catalog_item": "sys_id_of_laptop_request"
},
"actions": [
{
"type": "Create Record",
"table": "task",
"values": {
"short_description": "{{variables.short_description}}",
"assignment_group": "{{variables.assignment_group}}"
}
},
{
"type": "Send Email",
"to": "{{variables.email}}",
"subject": "Request Submitted",
"body": "Your request {{variables.short_description}} has been submitted."
}
]
}Refer to the exhibit. The following is a Business Rule that runs on the Catalog Item table: current.work_notes = 'Automated update: ' + gs.nowDateTime();
Refer to the exhibit. The following is a snippet from a Service Portal widget's client controller:
c.data.userGroups = [];
c.server.get({ action: 'getUserGroups' }).then(function(response) {
c.data.userGroups = response.data.groups;
});var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('state', 'requested');
gr.addQuery('approval_for', gs.getUserID());
gr.query();
while(gr.next()){
gr.state = 'approved';
gr.update();
}{
"name": "Submit Request",
"trigger": {
"type": "record",
"table": "sc_req_item",
"condition": "stage IN submitted,approved"
},
"actions": [
{
"type": "approval",
"table": "sc_req_item",
"field": "approval"
}
]
}> glide.element.security.level = high > glide.ui.escape_text = false
Refer to the exhibit.
Catalog Client Script (onChange) on variable 'category':
```javascript
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
var subcat = g_form.getControl('subcategory');
if (newValue == 'hardware') {
subcat.setOptions({laptop: 'Laptop', desktop: 'Desktop'});
} else if (newValue == 'software') {
subcat.setOptions({os: 'Operating System', office: 'Office Suite'});
}
}
```Refer to the exhibit.
Business Rule (async) on Incident 'update':
```javascript
(function executeRule(current, previous /*null when async*/) {
if (current.state == 6) { // state 6 = resolved
var gr = new GlideRecord('task');
gr.addQuery('parent', current.sys_id);
gr.addQuery('state', '!=', 3); // 3 = closed complete
gr.query();
while (gr.next()) {
gr.state = 3;
gr.update();
}
}
})(current, previous);
```Refer to the exhibit.
UI Policy condition:
```javascript
if (g_form.getValue('department') == 'IT' && g_form.getValue('category').indexOf('hardware') != -1) {
g_form.setMandatory('cost_center', true);
} else {
g_form.setMandatory('cost_center', false);
}
```(function execute(inputs, outputs) {
var gr = new GlideRecord('sys_user');
gr.get('user_sys_id', inputs.user_sys_id);
if (gr.isValidRecord()) {
outputs.user_email = gr.email;
outputs.user_department = gr.department;
} else {
outputs.error = 'User not found';
}
})(inputs, outputs);{
"sys_id": "catalog_item_123",
"name": "Laptop Request",
"variables": [
{"name": "model", "type": "string", "mandatory": true},
{"name": "remarks", "type": "string", "mandatory": false}
],
"record_producer": {
"name": "Produce Laptop RITM",
"table": "sc_req_item",
"mappings": [
{"variable": "model", "target_field": "short_description"},
{"variable": "remarks", "target_field": "comments"}
]
}
}