0

Good morning,

I have a list with two columns: one is username (person or group), and the other is status (hyperlink or picture). The status column hyperlink pulls an image from an internal "whiteboard" where people can set their status to "in", "out", "lunch", etc. I would like to be able to filter the list so I can only see users who's status is "In". The images returned by the hyperlink query are simple enough: whiteboard-url/in.gif, whiteboard-url/out.gif, etc. Is there an easy way to do this?

(The ultimate goal of this is to display the person "on duty" on our main page, by referencing this list.)

Any help is greatly appreciated!

Edit: 12/15 - I've been looking into javascript to accomplish what I'm trying to do, but am obviously having no success. Would someone be kind enough to see what I've done wrong here? I've found this code snippet and made changes but still no luck.

var siteUrl = '/MySPSite';

function retrieveListItems() {

    var clientContext = new SP.ClientContext(siteUrl);
    var oList = clientContext.get_web().get_lists().getByTitle('SPListName');

    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query><Where><BeginsWith><FieldRef Name=\'Status\'/>' + 
        '<Value Type=\'URL\'>whiteboard-url/in.gif</Value></BeginsWith></Where></Query></View>');
    this.collListItem = oList.getItems(camlQuery);

    clientContext.load(collListItem);

    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));        

}

function onQuerySucceeded(sender, args) {

    var listItemInfo = '';

    var listItemEnumerator = collListItem.getEnumerator();

    while (listItemEnumerator.moveNext()) {
        var oListItem = listItemEnumerator.get_current();
        listItemInfo += '\nStatus: ' + oListItem.get_item('Status') + 
            '\nName: ' + oListItem.get_item('Name'); 
    }

    alert(listItemInfo.toString());
}

function onQueryFailed(sender, args) {

    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}

1 Answer 1

1

You can create three different view for all three status . See in the ribbon you have option as Create View. Click on that and then add your filter condition like in Status "IN" you can select Filter to show only items when it is In. SAme you need to do for other Views

After wards you can keep these View links in the Quick Launch

3
  • Ankit, thanks for your reply. When I attempt to create a new view, I am unable to filter on my status column; it doesn't show up in the dropdown for "Show the items when column". Research has suggested that the column type "Hyperlink or Picture" is not supported by this type of filtering. Maybe I am missing something here?
    – CPD485
    Dec 8, 2016 at 13:45
  • yes i missed that... hyper link or picture wont show in Filter option.. guess you need to go for custom coding to have this filter option Dec 8, 2016 at 13:48
  • Blah! I'm okay with modifying code but not nearly skilled enough to write my own. I was hoping there would be an easy solution that I had overlooked. :) Thanks!!
    – CPD485
    Dec 8, 2016 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.