Transform For Loop Issue

Any ideas why my iterator isnt picking up in my concat function? The iterator i is indeed updating with each pass of the for but not in the concat.


workids should be
const workids = []

Instead of concat in the loop use

Thanks Scott, but I need the results as a string so I can use it in another HTTP call. Either case the iterator still didn't update in the write statements.

Remove the second param (comma) in the push.
What should the formatting be for the http call?

Same thing. The iterator I doesn't update during write, but if put I into console it would show as incrementing as expected.

API call should be formatted like this, this transform is for the ids param of the call.

tried this to using the array and then return a .join() but the i inside .push() isn't iterating as expected, resulting in the same record being added to the array

var workids = [];
for (var i = 0; i <; i++) {
return workids.join(',');

output is repeating [i] = 0 in the array

const dataRetreived = [1,2,3,4,5,6,7,8]; // this is your GetWorkItems data
const workids = [];
for(i=0;i< dataRetreived.length; i++){
return "" + _.toString(workids).replace(/\"/g, "")

Thanks for you help! Taking the static value approach I was able to work through the source data 'dataretrieved' and was able to back into the data I needed.

Thanks for the assist!!!

var workids = [];
var data = {{formatDataAsObject(}}

for (var i = 0; i < data.length; i++) {
return workids.join(',');

1 Like