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());
}