i want to take value of the saved search result fr...
# suitescript
v
i want to take value of the saved search result from this
Copy code
"SUM(formulanumeric)_1": "0",
how to take it?
r
If this is a saved search that was created script side on the fly, you can usually send the same object to
Result.getValue()
that was sent as a search column. If created in the UI, you can use the saved search export tool to get the same info.
Oh, I know the problem you're facing. This is a pretty nightmarish thing, and I don't recall exactly how I resolved the issue. I think @NElliott’s comment from earlier is what I came up with. You should also be able to access it by treating the SearchResult object like any other object. It's not a documented way to work with data, but it should work, I think. I.e.
const val = result["SUM(formulanumeric)_1"]
I think it's actually more like
const val = result.values["SUM(formulanumeric)_1"]
. I don't recall offhand. Inspect the object
e
How did you arrive at
"SUM(formulanumeric)_1": "0",
? That looks to me like you're logging out a plain JS object. Like @reptar says, if you already have a plain object, you can read it like any other object:
Copy code
let myResult = {'SUM(formulanumeric)_1': 0}

myResult['SUM(formulanumeric)_1'] // => 0
r
I think they're logging out a
SearchResult
object.