<@U6UNST1E0> in SuiteScript 1.0 you can use someth...
# suitescript
h
@markr in SuiteScript 1.0 you can use something like searchColumns = search[0].getAllColumns() to get all the columns from your search and then search[i].getValue(searchColumns[0]) to get the value from your first column, etc. I am not certain off the top of my head how to get the equivalent for SuiteScript 2.0.
m
hi
h
hello
m
I'm currently doing something like this:
Copy code
for(var i = 0; i < arr_res.length; i++){
          var allcols = arr_res[i].getAllColumns();
          var allvals = new Array();
          for(var col = 0; col < allcols.length; col++){
               var lbl = allcols[col].getLabel();
               allvals.push(arr_res[i].getValue(lbl));
          }
// other code after I get values
}
and it's not croaking but all the values are null
g
I think this solution is better than the one I suggested.
But I believe getValue will work on the column, and not necessarily the label.
As Hunter suggested.
m
okay so I shouldn't use the label
but I'm on the right track then?
h
I would get the label for the first column, then the value, then push that to your array.
m
so would I be using arr_res[i].getValue(col) then?
or would it be arr_res[i].getValue(allcols[col]) at that point?
r
arr_res[i].getValue(allcols[col]) is the right syntax
✔️ 1
👍 1
h
so, var lbl = allcols[col].getLabel(); and var value = arr_res[i].getValue(allcols[col]) as rustshackles stated
👍 1
✔️ 1
m
man talking stuff out makes things so much easier, that worked
h
excellent!
m
thanks guys, I thought my hair was gonna turn grey on this one for sure