Add variables to catalog task from multiple catalog items

Dazler
Mega Sage

Hi,

 

Workflow editor made it easy to add variables from multiple catalog items to a single catalog task activity by using the slush bucket, but in flow designer when creating a catalog task you have to select only one catalog item.  This makes it difficult to create a single Flow for multiple catalog items.

 

I know that variables sets can be used, but many of our forms have different fields and are needed to be shown on the catalog task for the assigned to user to see.

 

This makes it difficult to truly maintain.

 

Has anyone figured a way to add the variables to the create catalog task for multiple catalog items in Flow Designer?

10 REPLIES 10

@Dazler 

nope

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

@Ankur Bawiskar 

 

What if I chose to create task instead and not create Catalog Task, is there a script that allows you to show the variables from that item to the task through script?

@Dazler 

check this link

https://community.servicenow.com/community?id=community_article&sys_id=4837201c1ba28050fff162c4bd4bc... 

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

Hi Dazler,

Were you able to find a solution? I'm also trying to make a reusable flow for multiple catalog items that may have different variables.

Hi @Tyler38 

 

Yes, I did find a solution.  I ended up creating a subflow called add variables to Task.  This subflow is used to get all the variables associated to the requested Item of the catalog task.  I placed this subflow after the Create a catalog task action.

 

Dazler_0-1724258521299.png

 

I deactivated the wait on the catalog task and I didn't choose a catalog item because the variables will get added in the Add variables to Task.  The only thing I pass to the Add Variables to Task subflow is the sys_id of the catalog task and Requested item.

 

Dazler_1-1724258579681.png

 

Dazler_2-1724258661760.png

 

I used the following link that Ankur Bawiskar provided to help me develop the Add variables to Task subflow.  It helped me to understand what tables to look up and what queries I should use to create the subflow.

 

https://www.servicenow.com/community/developer-articles/adding-variables-to-a-task-via-a-script-inst...