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

harinya
Tera Contributor

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

 

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

KieranAnson_1-1744003250314.jpeg

 

 

KieranAnson_0-1744003211801.jpeg

 

Can you share a screenshot of your current automatic response setup (of the modal that appears)

@Kieran Anson 
But i don't see the if /Then conditions in the automated Response

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