coolpb
Design Dabbler

SPServices GetListItems query Multiple Columns

Hi All,

 

Tried to find this issue in other post but I have not been able to get anything. I am trying to use SPservices jquery script lookup valuer across 2 columns, I was hoping someone would be able to assist:

 

I have a sharepoint list named journal spservices tutorial and i got the query against the Title working no problems. However when it is querying against multiple columns Title and Product. I get empty results:

 

2019-08-23_15-31-50.jpg

 

 

NWF$(document).ready(function() {
  //The source data for the autocomplete is the Journals list  
  //Store the journal titles in a array variable  
  var externalParties = [];
  NWF$().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "Journals",
    CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='Product' /></ViewFields>", //the name needs to be changed accordingly   
    completefunc: function(xData, Status) {
      NWF$(xData.responseXML).SPFilterNode("z:row").each(function() {
        externalParties.push([NWF$(this).attr("ows_Title"),NWF$(this).attr("ows_Product")]);
      });
    }
  });
  //journalinput is added on the control in the NF  
  NWF$("#" + journalinput).autocomplete({
    source: externalParties
  });
});

 

0 Kudos
Reply
1 Reply
jaxkookie
Design Dabbler

Re: SPServices GetListItems query Multiple Columns

you are missing your string quotes. "[" + $(this).attr("ows_Title") +","+$(this).attr("ows_Product")++"]";

0 Kudos
Reply