Hi hogi
Thanks for the tip.
I added your code into the Workflow Builder step. It was executed without error code, but nothing has changed in the data table.
Noted that both of our code (with&without "String") work properly when running with Script window, but somehow it does not work in the WorkFlow Builder.
I figure out that we need to use this instead.
Column(dt, columnName[j])
Here is the code that works with Workflow Builder.
searchWords = ", ";
columnName = dt << Get Column Names("String");
N = N Items( columnName );
For(j=1, j<= N, j++,
x = contains(columnName[j], searchWords);
colName = Substr(columnName[j], x+length(searchWords));
If(x > 0,
Column(dt, columnName[j]) << Set Name(Left(colName, Length(colName)-1));
);
);