Utilities
From parsing query string parameters to getting information about the current user, these utility functions are handy tools for building client-side solutions.
Function Name | Short Description | Introduced |
---|---|---|
$().SPServices.SPConvertDateToISO | Convert a JavaScript date to the ISO 8601 format required by SharePoint to update list items. | 2013.01 |
$().SPServices.SPDebugXMLHttpResult | This function displays the XMLHttpResult from an Ajax call formatted for easy debugging. You can call it manually as part of your completefunc. | 0.2.10 |
$().SPServices.SPDropdownCtl | The function finds a dropdown in a form based on the name of the column (either the DisplayName or the StaticName) and returns an object you can use in your own functions. | 2014.01 |
$().SPFilterNode | Can be used to find namespaced elements in returned XML, such as rs:data or z:row from GetListItems. | 0.7.0 |
$().SPServices.SPGetCurrentSite | This utility function, which is also publicly available, simply returns the current site’s URL. It mirrors the functionality of the WebUrlFromPageUrl operation. | 0.2.4 |
$().SPServices.SPGetCurrentUser | This function returns information about the current user. It is based on an insightful trick from Einar Otto Stangvik (see Credits). | 0.3.1 |
$().SPServices.SPGetDisplayFromStatic | This function returns the DisplayName for a column based on the StaticName. | 0.4.0 |
$().SPServices.SPGetLastItemId | Function to return the ID of the last item created on a list by a specific user. Useful for maintaining parent/child relationships. | 0.4.0 |
$().SPServices.SPGetListItemsJson | SPGetListItemsJson combines several SPServices capabilities into one powerful function. By calling GetListItemChangesSinceToken, parsing the list schema, and passing the resulting mapping and data to SPXmlToJson automagically, we have a one-stop shop for retrieving SharePoint list data in JSON format. No manual mapping required! | 2014.01 |
$().SPServices.SPGetQueryString | The SPGetQueryString function returns an array containing the Query String parameters and their values. | 0.5.1 |
$().SPServices.SPGetStaticFromDisplay | This function returns the StaticName for a column based on the DisplayName. | 0.5.4 |
$().SPServices.SPListNameFromUrl | Returns the current list’s GUID *if* called in the context of a list, meaning that the URL is within the list, like /DocLib or /Lists/ListName. | 0.5.7 |
$().SPServices.SPScriptAudit | The SPScriptAudit function allows you to run an auditing report showing where scripting is in use in a site. | 0.4.8 |
$().SPXmlToJson | SPXmlToJson is a function to convert XML data into JSON for client-side processing. | 0.7.1 |