The CreatorCon Call for Content is officially open! Get started here.

Through catalog task i need update in dashboard active machines to make it false

mani55
Tera Contributor

i have one catalog form is there under that we have machine(hostname) variable is there. once catalog is submitted after it's create catalog task .in that catalog task what we need to do is we have security exception dashboard is there under that we have active machines report is there under that we need to make that active true to false so how we can archive.

1 ACCEPTED SOLUTION

Viraj Hudlikar
Tera Sage
Tera Sage

Hello @mani55 

 

Use a Flow Designer flow triggered by the Catalog Task state change. The flow will find the corresponding machine record and update its active field to false.


Below are some sample screenshots that will help to set up the flow.

 

The trigger will be something like this. 

VirajHudlikar_0-1758693877322.png

 

Next, let's get the variable value, which we need to use further to get it updated.

VirajHudlikar_1-1758694006418.png

 

Now we have a variable that was selected by the user while submitting the request. Now we will use that value to fetch the actual record from the table where it resides.

VirajHudlikar_2-1758694095372.png

 

Now last step to update that record we fetched from previous step

VirajHudlikar_3-1758694198216.png

 

Now using the above sample flow, you can achieve the same.

 

If my response has helped you, hit the helpful button, and if your concern is solved, do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

 

View solution in original post

3 REPLIES 3

Viraj Hudlikar
Tera Sage
Tera Sage

Hello @mani55 

 

Use a Flow Designer flow triggered by the Catalog Task state change. The flow will find the corresponding machine record and update its active field to false.


Below are some sample screenshots that will help to set up the flow.

 

The trigger will be something like this. 

VirajHudlikar_0-1758693877322.png

 

Next, let's get the variable value, which we need to use further to get it updated.

VirajHudlikar_1-1758694006418.png

 

Now we have a variable that was selected by the user while submitting the request. Now we will use that value to fetch the actual record from the table where it resides.

VirajHudlikar_2-1758694095372.png

 

Now last step to update that record we fetched from previous step

VirajHudlikar_3-1758694198216.png

 

Now using the above sample flow, you can achieve the same.

 

If my response has helped you, hit the helpful button, and if your concern is solved, do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

 

Ankur Bawiskar
Tera Patron
Tera Patron

@mani55 

Sorry please share screenshots of your form etc and phrase the question properly on what's your requirement and where are you stuck

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Connectmustaq
Tera Expert

Hi @mani55 ,

 

when a catalog request is submitted and reaches the catalog task, you want to set the "active" status of a machine within the "Active Machines" report (presumably a custom table or CI record referenced by the hostname variable) from true to false

follow these ServiceNow best practices:
1. How to Set 'Active' to False from Catalog Task:
The "Active Machines" report is likely built on a CMDB or custom table tracking machine/host records, with an active boolean field.
2. Use Workflow/Flow Designer Activity
-  In the catalog item's fulfillment workflow (classic Workflow or Flow Designer), add a script step (Run Script in classic workflow, or Script step in Flow Designer).

-After the Catalog Task is created, your logic will trigger from this point
Here’s an example using a typical Server Script activity (for Workflow), assuming your variable name is "machine" and your table is "u_machine":
// Get the hostname from the catalog item's variables
var hostname = current.variables.machine;

// Query the machine table (replace 'u_machine' with your actual table)
var gr = new GlideRecord('u_machine');
gr.addQuery('hostname', hostname);
gr.query();
while (gr.next()) {
gr.active = false;
gr.update();
}

 

  • Place this script in the Workflow activity that follows your Catalog Task creation.
  • If using Flow Designer, use the "Look Up Record" and "Update Record" actions instead, mapping the hostname from variables and setting "active" to false

This process enables full automation: when your catalog task is created as part of request fulfillment, it will immediately set the relevant machine to "inactive" and update your dashboard/report accordingly.

 

if it is helpful, please hit the thumbs button and accept the correct solution by referring to this solution in the future it will be helpful to them.

 

Thanks & Regards,

Mohammed Mustaq Shaik