My goal is to read columns from the list TestList
and write the element into an other list's new form's textbox TestText
. But looks like even if I can acces the TestList
the script return only with nulls. For example if the targeted column Szam
have 4 elements then it return with 4 null if I add one more element it returns with 5 null, but I can't figure out why not contains the right values. Here is my code:
$(document).ready(function () {
$SP().list("TestList","http://.../sites/Registry/").get(
{
fields: "Szam"
},
function getData(data)
for (var i = 0; i < data.length; i++) {
console.log(data[i].getAttribute("Szam"));
// $("#TestText").val(data[i].getAttribute("Szam"));
}
});
});
Both SP list is under the same site. I am using SP 2013, jquery.min.js and sharepointplus-4.0.min.js. The column Szam
contains 5 element as text {1,2,3,4,5}. I as a result I can see the "null"s in the console log 5 times. In the final version I am planning to add something like where 'Szam = "5"'
and search in other columns to get only 1 element as result and insert it to the TestText
. I am new to both SP and JS so it can be even trivial mistakes. Thank you very much for your kind help!