0

I have a requirement to retrieve the user email from created by column. I have tried with get_lookupValue(), but I got system object error message. Is there any solution to retrieve the user email from created by column using JavaScript?

Code attempted:

var Item=get_item('Author'); 
var user=Item.get_lookupValue();
2
  • Add code you are using, to help you better
    – Anuja
    Sep 17, 2014 at 10:38
  • var Item=get_item('Author'); var user=Item.get_lookupValue();
    – Gowtham
    Sep 17, 2014 at 11:02

1 Answer 1

0

get_item('Author'); should return a user object. Simply use the get_email() method to get the user email:

var ctx = new SP.ClientContext();
var list = ctx.get_web().get_lists().getByTitle('My list');
var item = list.getItemById(1);
ctx.load(item);
ctx.executeQueryAsync(function(){
    alert(item.get_item('Author').get_email());
}, /* error handling here */ );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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