I am having problems with some strings i have the following code in javascript:

_result = currentQuizItem.get_fieldValues()["Audience"];

"Audience" is a column in my sharepoint list, and it has some names but I am not able to convert them to string

I am trying the following _result.toString(); but it causes an error

how can i do that via javascript?

  • what is the type of _result? if it is an array of string, the use _result.join(' '). print the value of _result in console using console.dir(_result) and update the question. – Atish Dipongkor - MVP Dec 3 '15 at 9:39
  • var _result it is a variable. in audience column i have a name value but i cannot convert it toString(); @AtishDipongkor any suggestion now – Nderon Hyseni Dec 3 '15 at 9:53
  • use console.dir(_result) and let me know what it prints – Atish Dipongkor - MVP Dec 3 '15 at 9:55
  • when i wrote console.dir(_result) nothing happend! – Nderon Hyseni Dec 3 '15 at 10:06
  • 1
    What is the type of your Audience column? Is it a multi-value user column? And if you didn't already know, when you do console.dir you need to open your browser's console (press F12) to see what it prints. – Submits Dec 3 '15 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.