Hello Everyone
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2024 10:54 AM
I have two fields requested for(reference) and devices (list collector)
My requirement is to auto populate requested for assigned devices(from hardware table ) in devices field. Please help me with the solution.
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2024 11:00 AM
Hi @Anvesh Reddy123,
Use this script:
// Replace placeholders with actual field and table names
var hardwareGR = new GlideRecord('YourHardwareTable');
hardwareGR.addQuery('assigned_to', current.requested_for); // Replace 'assigned_to' with actual field name
hardwareGR.query();
var devices = [];
while (hardwareGR.next()) {
devices.push(hardwareGR.name); // Replace 'name' with actual field name
}
current.devices = devices.join(', ');
Thank you, please make helpful if you accept the solution.