In my Server Side script code I would like to take the field value and convert it to an array and each array element (arry elements is checked items) concatenate a string of 2 letters. (always the same leters)
Have any idea how can I solve this?
I wrotthis code but not working…
var Sedes = dSorteo.getItemValue(“SedeParticipante”);
Subject: What is your expectation when passing an array as the key?
Correct me if I’m wrong, but I suspect you are attempting to use an array as a key based on a false understanding of it’s use. If you are expecting each element in the array to be used as a key matching the first column in the view and returning a set of documents which is then combined with the documents returned from each other element in the array to provide a combined document collection then that is an incorrect use of the method.
As per the help documentation, “The first element in the vector is compared to the first sorted column in the view; the second element is compared to the second sorted column; and so on.”, and thus will only return those documents where ALL elements in the array are correctly matched with each corresponding column value.
What I think you really need to do is use a method to loop through each element in the array to get the documents you want and merge them into a single collection. So something like the following (not tested so you may need to correct some of the syntax):
var Sedes = dSorteo.getItemValue(“SedeParticipante”);
Sedes+“$V”;
var allDocs:NotesDocumentCollection = db.getProfileDocCollection(“GiveMeAnEmptyCollection”);
for ( var i=0;i<Sedes.length;i++ ){
var dcEmpleados:NotesDocumentCollection = vEmpleados.getAllDocumentsByKey(Sedes[i], true);
allDocs.Merge(dcEmpleados)