CAML query to get items from SharePoint 2013 list

I am attempting to get certain items from a list in SharePoint 2013 by using CAML query, once set to variables these item are to be called to a custom form to populate fields. I have set an alert in the SPServices Call and even it is not working, any direction would be helpful.

function GetUsers()
        //The Web Service method we are calling, to read list items we use 'GetListItems'
        var method = "GetListItems";
        //The display name of the list we are reading data from
        var list = "EmployeeData";

        var fieldsToRead =     "<ViewFields>" +
                                "<FieldRef Name='EmployeeID' />" +
                                "<FieldRef Name='FirstName' />" +
                                "<FieldRef Name='LastName' />" +
        var query = "<Query>" +
                        "<Where>" +
                            "<Neq>" +
                                "<FieldRef Name='EmployeeID'/><Value Type='Number'>0</Value>" +
                            "</Neq>" +
                        "</Where>" +
                        "<OrderBy>" +
                            "<FieldRef Name='EmployeeID'/>" +
                        "</OrderBy>" +
        //Here is our SPServices Call where we pass in the variables that we set above
                operation: method,
                async: false,  //if you set this to true, you may get faster performance, but your order may not be accurate.
                listName: list,
                CAMLViewFields: fieldsToRead,
                  CAMLQuery: query,
                      //this basically means "do the following code when the call is complete"
                    completefunc: function (xData, Status) {
                        //this code iterates through every row of data returned from the web service call
                        $(xData.responseXML).SPFilterNode("z:row").each(function() {
                            //here is where we are reading the field values and putting them in JavaScript variables
                            //get the title field (ID)
                            var empNumber = ($(this).attr("ows_EmployeeID"));
                            //get eployee first name
                            var empFname = ($(this).attr("ows_FirstName"));
                            //get emplyee last name
                            var empLname = ($(this).attr("ows_LastName"));

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

IsaacSharePoint Client Side DeveloperCommented:
What error do you get?
cbridgesazAuthor Commented:
There is no error reported, and the alert does not show. Everything looks right to me but nothing happens.
IsaacSharePoint Client Side DeveloperCommented:
Are the spservices and jquery libraries uploaded?
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

cbridgesazAuthor Commented:
Yes they are.
IsaacSharePoint Client Side DeveloperCommented:
Your alert is not firing because it's not recognizing the libraries.  Make sure the path to the files are correct.

Also, when you call the function is the file name correct?

Can you show a little bit more of your code?
cbridgesazAuthor Commented:
The libraries are : <link  type="text/css" rel="stylesheet" href="//" />
<!-- Reference jQuery on the Google CDN -->
<script type="text/javascript" src="//"></script>
<!-- Reference jQueryUI on the Google CDN -->
<script type="text/javascript" src="//"></script>
<!-- Reference SPServices on cdnjs (Cloudflare) -->
<script type="text/javascript" src="//"></script>

and the function is called by $(document).ready(function(){

Also, if I change "<FieldRef Name='EmployeeID/'>" to "<FieldRef Name='ID/'>" I get an alert that reads undefined
cbridgesazAuthor Commented:
I have found the solution!! I was importing a table from excel into SharePoint and using the query to retrieve data from the created list. The problem is that the headers from the table had spaces, and it was these columns that the CAML query had trouble with.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
IsaacSharePoint Client Side DeveloperCommented:
Ahhhh......good catch!  I'm glad you found the solution!
cbridgesazAuthor Commented:
I started by trying to read another list that was manually created in SharePoint designer and the code worked, I then noticed that only difference other than one being exported from excel was the manually created list had single word columns and no spaces.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.