Object returned $().SPServices.SPGetStaticFromDisplay on multiple columns

Mar 15, 2015 at 5:07 AM
I get the output as "[object Object]", is my syntax right?

thisStaticNames = $().SPServices.SPGetStaticFromDisplay ({
listName: mylistname,
columnDisplayNames: ["column 1","column 2"]
});
alert(thisStaticNames);
Coordinator
Mar 15, 2015 at 4:53 PM
You're getting back an array of values (since you asked for it), so if you alert the result, it'll show as an object.

M.
Mar 15, 2015 at 5:09 PM
Can you please let me know the syntax to alert the returned array contents.
Coordinator
Mar 15, 2015 at 5:58 PM
Several options. Alerting isn't really what you want to do with the values, though, so you should look at how to use the array values. They will be thisStaticNames[0] and thisStaticNames[1].

M.
Mar 16, 2015 at 4:31 PM
Thank you for the reply. Yes it returned as array, but i figured why the array didnt return results for me.

Instead of using index, i had to use the column name passed:

thisStaticNames['column 1'] and thisStaticNames['column 2'].

It worked.

Thanks again. This tool has been really really helpful!! Appreciate all your efforts!