简体   繁体   中英

Get value of variable that stores a a function

I know this is a SharePoint question, but I feel more like it is a javascript question also. I'm using this great tool to fill some of the fields in my SharePoint list (web part). It works great when I do this one by one, but I'm trying to request multiple column values, but I can't get it to work.

var thisUsersValues = $().SPServices.SPGetCurrentUser({
fieldNames: ["ID", "Name", "SIP Address"],
debug: false
});

How can I get specific column value (eg "Name") from this array?

Thanks!

Looking at the source it appears that the SPServices.SPGetCurrentUser() function returns an associative array with the keys being the fieldNames that were passed to it.

This means to access the field you can use

thisUserValues.Name

Or

thisUserValues['Name']

Disclaimer: I have no experience with sharepoint or this particular jQuery library.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM