How to convert task variable from one stage to an array object in another stage

Copper Contributor

I have a requirement to convert the task variable which was set in one stage(say stage1) to be available in stage two(say stage2), this I am able to achieve. But the problem is this task variable is actually a space separated value and on the basis space I want to convert this into an array, so that I can iterate over each item and perform the business.
I have tried .split that did not worked. Anything I am trying with this variable in stage two, it is actually evaluating to its value. So that is basically causing pipeline to fail.
Please help here how do I convert the task variable to an array.



1 Reply