checklist component in workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2024 02:43 AM
Hi
I have requirement for the checklist component in ui builder for servicenow. My requirement is it should fetch records and display the records description which has state is open and assigned to current logged in user how to achieve my requirement using checklist component.
I have tried by using the data source .I have used scriplet data source in that I have written the script:
(function() {
var userSysId = gs.getUserID(); // Gets the current user's sys_id
var records = [];
var gr = new GlideRecord('incident'); // Change 'incident' to your desired table
gr.addQuery('state', '1'); // Assuming '1' is the state for Open, adjust as needed
gr.addQuery('assigned_to', userSysId); // Filters records assigned to the current user
gr.query();
while (gr.next()) {
records.push({
label: gr.short_description.toString(), // Assuming you want to show the short description
value: gr.sys_id.toString() // Uses sys_id as the value, adjust if needed
});
}
return records;
})();
I have added this data source but after adding it I got like this .But I haven't missed any ) but it is showing like this.
If not following the correct procedure how can I achieve my requirement please help me.