Question: I have a Query String (URL) filter on my SharePoint 2013 page that is currently passing a string parameter which I then use to filter a list. This list is displayed in a view on my web part page. I want to add a "Title" object above my list view to show the value of the filter parameter that I'm passing to filter the list.

Does anyone know how I can do this? I looked through the web part options that were available to add, and couldn't find one to simply display the result of the query string filter.

Answer: 
```
 var context = new SP.ClientContext.get_current();
    var list = context.get_web().get_lists().getByTitle("ListName");
    var cQuery = new SP.CamlQuery();
    var camlXML = "<View><Query><Where><Eq><FieldRef Name='Author' LookupId='True'/><Value Type='Lookup'>" + _spPageContextInfo.userId + "</Value></Eq></Where></Query></View>";
    cQuery.set_viewXml(camlXML);
    var listitems = list.getItems(cQuery);
    context.load(listitems);
    context.executeQueryAsync(function() {
            var enumerator = listitems.getEnumerator();
            while (enumerator.moveNext()) {
                var item = enumerator.get_current().get_fieldValues();
                console.log(item);
            }
        },
        function(s, a) {
            console.error(a.get_message());
        });

```

Though it works, I prefer the query provided by Yayati to use `<UserID/>` in caml Query instead of `_spPageContextInfo.userId` , as this userid is only available on SharePoint application pages in browser. however you can use this query to get items of a specific user, instead of current user by passing the userid.
The Author column is of `LookUp` Type. Here is the complete list.

```
var ctx = new SP.ClientContext.get_current();
var list = ctx.get_web().get_lists().getByTitle("Vacation Replacement");
var query = new SP.CamlQuery();
var specifier = "<Where><Eq><FieldRef Name='Author' LookupId='True'/><Value Type='Lookup'><UserID/></Value></Eq></Where>";
query.set_viewXml("<View><Query>"+specifier+"</Query></View>");
var collListItems = list.getItems(query);
ctx.load(collListItems);
ctx.executeQueryAsync(
    function(){
        var enumerator = collListItems.getEnumerator();
        while(enumerator.moveNext()){
            var item = enumerator.get_current();
            alert("ID : " + item.get_id());
        }
    },
    function(sender,args){
        alert("Request Failed."+args.get_message() + "\n" + args.get_stackTrace());
    }
);

```