I have a SharePoint Online, 2013 setup. I want to create some functionality on the Document Set Welcome page using Metadata found in the content type.
I've managed to find the "Status" column, but I cannot figure out how to get the Created By column. Below is my working code for getting the Current User, as well as the Status.
<script type="text/javascript" src="./Content/Scripts/jQuery/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="./Content/Scripts/jQuery/jquery.SPServices.min.js"></script>
<script type="text/javascript">
$(function() {
var CurrentUser = $().SPServices.SPGetCurrentUser();
var query = "<Query><Where><Eq><FieldRef Name='ID' /><Value Type=\"int\">" + getQString('ID') + "</Value></Eq></Where></Query>";
$().SPServices({
operation: "GetListItems",
async: false,
webURL: $().SPServices.SPGetCurrentSite(),
listName: "Documents",
CAMLViewFields: "<ViewFields Properties='True' />",
CAMLQuery: query,
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function () {
//alert($(this).attr("ows_Title"));
alert($(this).attr("ows_Status"));
});
}
});
});
function getQString(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.search);
if (results == null)
return "";
else
return decodeURIComponent(results[1].replace(/\+/g, " "));
}
</script>
Is there a way to get the Created By column on the client side? I would then be using that value to see if they are the current user.