NElliott
12/22/2022, 4:45 PMconst columnsObj = [
{
"name":"salesrep",
"summary":"GROUP",
},
{
"name":"fxamount",
"summary":"GROUP",
}
];
[...]
let thisValue = soResults[x].getValue(columnsObj[0]);
I have some code that along the way has the const above.
I'm looping through search results and for each, looping through the columnsObj trying to pull back the result value.
I've tried backticking / JSON.stringify'ing and a plethora of approaches but none give me a result value.
If I take one of those columsObj objects and paste them directly in to the code at the point I assign the value to thisValue it works fine, kinda as expected really.
Can someone advise on the syntax I should use to retrieve the result value using the array object, or failing that, a better way of approaching it please?
Feeling mentally fried right now!
(I've output columnsObj[0] and it is as expected too, there's no scope issue etc)ehcanadian
12/22/2022, 4:58 PMmySearch.columns[0]
otherwise
const columnsObj = columns[0];
console.log(result.getValue(columnsObj));
NElliott
12/22/2022, 5:03 PMNElliott
12/22/2022, 5:07 PMbattk
12/22/2022, 5:14 PMbattk
12/22/2022, 5:15 PMbattk
12/22/2022, 5:16 PMcolumnsObj[c].toJSON()
NElliott
12/22/2022, 5:18 PMbattk
12/22/2022, 5:21 PMcolumnsObj[c]
does not have a type propertyNElliott
12/22/2022, 5:22 PMbattk
12/22/2022, 5:23 PMNElliott
12/22/2022, 5:26 PMNElliott
12/22/2022, 5:34 PM