Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Catalog Task, variable change value not captured in workflow

Tadz
Kilo Sage

Hi, I have some problem with Catalog Task.

I have a variable test from a catalog item where I passed it to the catalog task.

When I changed the value of test, it reflects in the requested item that it has been changed.

But in the workflow, I doesn't capture the change of value.

The workflow only accepts the change when you change the test value from the requested item.

Is there a better way to implement this or any suggestions.

Thanks,

Tadz

6 REPLIES 6

anurag92
Kilo Sage

Hi Cris,



I know it's a tad bit late.



I faced the same issue and the only workaround/solution I can implement was to create a BR onBefore update on a Catalog task.



So, if you want to track a change in variable 'xyz', BR would be something like:



if(current.variables.xyz.changesTo('Desired Value')


current.request_item.variables.xyz = current.variables.xyz;



This code will work on workflow activity on req item, that tracks a change in catalog variable.


Hi Jain,



Thanks for your input it would help a lot in the future


Also, my solution for this too is to delete and recreate the variable.



Thanks,


Tadz