assign catalog item using a script while using the Create Catalog Task action in flow designer

Efra Pruneda
Mega Guru

I am creating a subflow that is intended to be used from different catalog items.  this subflow receives the following input parameters: reference to the ritm record, reference to the assignment group and reference to the item (sc_cat_item).

while using the Create Catalog Task action in the subflow, I was able to use the first two parameters: ritm to the requested item field and the assignment group field. but I don't see how I can assign the catalog item. there is no script option there. It will be awesome if someone can help me to figure out how to use the third parameter and dynamically assign the item to allow this subflow to be 100% reusable.

thank you all in advance.

Efra

1 ACCEPTED SOLUTION

Ok, I have a better understanding of exactly what you're trying to accomplish. I don't think what you're trying to do is possible in the way that you're wanting.

JoeS1_0-1685030683511.png

Like you noted the Template Catalog Item field is not scriptable it's set to a single static value, even if it were scriptable how would you choose the variables to move from the Available to the Selected side so that they're displayed on the Catalog Task?

 

There is an option though, you could not populate the Catalog item field so that way you wouldn't have to worry about which variables to show or not. On the variable record itself is a field called "global" that is not on the variable form. This field, if set to true, will automatically display the variable on the RITM and the SCTASK records. This gives you the option to re-use your subflow but on the individual variable record control what displays and what doesn't on the SCTASK.

JoeS1_1-1685031143888.pngJoeS1_2-1685031154846.pngJoeS1_3-1685031167815.png

 

 

View solution in original post

10 REPLIES 10

I just tried this: I used the script option to populate the short description inside the create catalog task action.  if I do it this way, then the current. becomes relevant to the create catalog task action itself. 

/*
**Access Flow/Action data using the fd_data object. Script must return a value.
**Available options display upon pressing "." after fd_data
**example: var shortDesc = fd_data.trigger.current.short_description;
**return shortDesc;
*/
current.cat_item = fd_data.subflow_inputs.item;
return "Add more approvers one at a time.";

 but when I run it, I get the following error:

Error: Cannot set property "cat_item" of null to "6c7eadabdb407810ce881be3159619f7",Detail: Cannot set property "cat_item" of null to "6c7eadabdb407810ce881be3159619f7"