Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

When using SPServices, is it possible to use a variable to specify the column to be updated?

res = lists.quickUpdateListItem('MyListHere', { ID: ReqD, columnVar : userName });

In the above statement, is it possible to use the variable columnVar in this way? I have not been able to successfully get this to work. It does not throw an error, but it just simply doesn't update.

share|improve this question
    
Really? You edited my question to fix 'doesnt' to 'doesn't' ...? –  dah97765 Jun 20 '12 at 21:14
    
I have answer but I can't post it until more than 8 hours passes. I'll update soon :) –  dah97765 Jun 20 '12 at 21:18
add comment

1 Answer

This is possible, but its not very obvious. The library differentiates between what you're passing into the function. If you build an array and then pass that in instead, you can build this dynamically as I was hoping:

var columnVar = whatever your column name is;  
var myArray = new Object(); 
myArray['ID'] = ReqD; 
myArray[columnVar] = userName;
res = lists.quickUpdateListItem('MyListHere', myArray); 
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.