catalog item automation

vikaskumarc
Tera Contributor

How to achive these 2 requirments

 

Order Guide
If a order guide is selected to be retired we would need to first check to see if there are still any active catalog items associated to the order guide. we can check that in table sc_cat_item_guide_items
If not,
Approval workflow should remain the same with the order guide owner approving prior to the task creation and automation trigger
Automation should set the Active flag on the order guide in sc_cat_item table to Active=false
if yes,
Approval workflow should remain the same with the order guide owner approving
however in this case we would not trigger automation as we would need to review to see what to do with the catalog items that are still active on the order guide.

 

 

Stand Alone Catalog Item
Approval workflow should remain the same with the catalog item owner approving before task is create and automation triggered
Automation should set the Active flag in the sc_cat_item table to Active=false for the stand alone catalog item selected

3 REPLIES 3

kmohammed
Tera Guru

Hi Vikas,

 

Both requirements fit in one Flow Designer flow on the retirement request. Build a dedicated "Retire catalog item" request (catalog item / record producer) that captures the item to retire as a reference variable to sc_cat_item, then use this flow structure:

 

1. Trigger: Service Catalog (on the retirement item's flow), or a record trigger on your retirement request table if you run it outside the catalog.

2. Ask for Approval - approver = the owner of the selected item (dot-walk from the variable: item Owner). Nothing else in the flow runs until this is Approved, which gives you exactly the "owner approves before task creation / automation" sequence for both cases. If Rejected, end the flow.

3. ONLY for an order guide, add the active-item check AFTER the approval, so it reflects the state at decision time:

- Look Up Records on sc_cat_item_guide_items where Guide = the selected item AND Item.Active = true.

- Table structure note: order guides are held in sc_cat_item_guide, which extends sc_cat_item, and sc_cat_item_guide_items holds one row per included item (fields: Guide, Item, Order). So counting rows from that lookup with Item.Active = true is the exact check you described.

4. If the lookup count is 0: branch to Update Record on the selected item (sc_cat_item) and set Active = false, then create/close the catalog task with a work note that the guide was retired automatically.

5. If the lookup count is greater than 0: do NOT touch the Active flag. Create the catalog task for manual review and put the list of still-active items (from the lookup results) in the task description, so the reviewer decides per item - move it to another guide, or retire it as well - and the flow ends there.

6. Standalone catalog item path: skip steps 3-5. Approval (step 2) goes straight to Update Record setting Active = false on sc_cat_item, then create the task as you do today.

 

So the only real difference between your two requirements is the guide-items lookup branch in the middle; approval and the final Update Record are shared. One caution: set Active = false rather than deleting anything, and retire in a sub-production instance first - an inactive item disappears from the portal/catalog immediately, including from any other guide that includes it, which is another good reason the step 5 review branch should list every guide the item appears in, not just this one.

 

Regards,

Karimuddin

yashkamde
Tera Sage

Hello @vikaskumarc ,

 

you can implement a solution using a Flow Designer flow triggered by the retirement request..

1) Create a Flow :

  • Trigger: Updated / Created on your target table (e.g. sc_request)
  • Condition : Check if the item being retired is an Order Guide or Catalog Item (Class Field on sc_cat_item table)

2) Actions Logic :

  • Send an approval task to the Order Guide Owner.
  • Then you can check for active associated catalog items (look up record step)
  • Look Up Records on the sc_cat_item_guide_items , Query: guide = [Your Order Guide SysID] AND item.active = true.

3) Use an If/Else branch based on the output of the check above:

  • Branch IF "No" (No active items remain) > Update Record (active = false)
  • Branch IF "Yes" (Active items still exist) > Create a manual review task for the owner

4) Process Standalone Items :

  • Approve: Send an approval task to the Catalog Item Owner.
  • Automate: Immediately after approval, update the Catalog Item record to Active = false and generate standard tasks.

 

If my response helped mark as helpful and accept the solution.

Aditya_hublikar
Giga Sage

Hello @vikaskumarc ,

 

 I have tried your usecase :

Aditya_hublikar_8-1793781955737.pngAditya_hublikar_9-1793781988151.png

 

 

Steps :

Aditya_hublikar_1-1793778847425.png

 

Aditya_hublikar_2-1793778888956.png

 

Aditya_hublikar_3-1793778923403.png

 

 

 

 

Aditya_hublikar_6-1793779563558.png

 

 

 

 

Screenshot 2026-11-04 132650.png

Aditya_hublikar_10-1793782028730.png

 

Screenshot 2026-11-04 132723.pngScreenshot 2026-11-04 132732.pngScreenshot 2026-11-04 132743.png

 

Screenshot 2026-11-04 132757.pngScreenshot 2026-11-04 132822.pngScreenshot 2026-11-04 132831.pngScreenshot 2026-11-04 132849.pngScreenshot 2026-11-04 132944.pngScreenshot 2026-11-04 133007.pngScreenshot 2026-11-04 133043.png

 

It working fine as per requirement .

 

If this helps you then mark it as helpful and accept as solution .

Regards,

Aditya