- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 02:20 AM
HI @Ankur Bawiskar , @Kieran Anson
Can you please help to glide the table central solution table data and that Asset value is onboarded or not
try {
// Step 1: Query the Central Solution Table
var centralSolutionGr = new GlideRecord('central_solution_table'); // Replace with the actual Central Solution table name
centralSolutionGr.query();
while (centralSolutionGr.next()) {
// Get the asset field from the Central Solution Table
var asset = centralSolutionGr.getValue('asset'); // Replace 'asset' with the actual field name
if (asset) {
// Step 2: Query the Business Application Table using the asset as the Instance ID
var businessAppGr = new GlideRecord('business_application_table'); // Replace with the actual Business Application table name
businessAppGr.addQuery('instance_id', asset); // Replace 'instance_id' with the correct field name in the Business Application Table
businessAppGr.query();
if (businessAppGr.next()) {
// Found a match: Business Application Instance ID matches Central Solution Asset
gs.info('Match Found: Central Solution Asset = ' + asset + ', Business Application Instance ID = ' + businessAppGr.getValue('instance_id'));
// Step 3: Check if the asset is "Onboarded" and update the created text field
if (asset === 'Onboarded') {
centralSolutionGr.setValue('created_text_field', 'Asset is Onboarded'); // Replace 'created_text_field' with the correct text field name
centralSolutionGr.update(); // Save the record with the updated value
gs.info('Updated created text field for Central Solution Asset: ' + asset);
}
} else {
// Log if no match is found in Business Application Table
gs.info('No match found for Asset: ' + asset + ' in Business Application Table');
}
}
}
} catch (error) {
// Log any errors for debugging purposes
gs.error('Error in script: ' + error.message);
}
will this work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 02:22 AM - edited 04-07-2025 02:22 AM
Automate Response will give default Answer, i didn't get that answer how will show
not able see if and Then cond also
please help on this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2025 10:21 PM
Ah, good idea to use the automated response feature!
In combination to using the script, have you used that with the condition builder?
So your If/then condition would invoke the automate response when a previous question is the partial/complete answer you desire
Can you share a screenshot of your current automatic response setup (of the modal that appears)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 12:33 AM
@Kieran Anson
But i don't see the if /Then conditions in the automated Response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 08:30 PM
You can see this functionality is shown in the docs: https://www.servicenow.com/docs/csh?topicname=automate-response.html&version=latest
If you're not seeing the option, upgrade the plugin/store app and if that fails, speak with ServiceNow Support