Skip to content

Instantly share code, notes, and snippets.

View danawesome's full-sized avatar

D. Awesome danawesome

  • Orion Media
  • Idaho, USA
View GitHub Profile
@danawesome
danawesome / SharePoint-2013-REST-API-ES6-Demo.md
Last active October 20, 2022 16:08
SharePoint REST API Delete List Items

Answer to StackExchange SharePoint Question "[Deleteing SharePoint List elements with specific values in a column][2]"

Sample Example: using REST API and ES6

I wanted to provide an example that doesn't use jQuery.

The answer is longer than it strictly needs to be. However, if you are doing this a lot, the helpers and utility functions, with some light error handling, come in handy.

The code below assumes you have [JSON Light][1] enabled in your SharePoint Environment. (Supported in 2013 via SP1 and add some assembly references to the web.config. JSON Light is present in 2016, 2019, SPO. Not supported in 2010)

@danawesome
danawesome / working-code.js
Last active March 5, 2020 17:52
REST calls from one SharePoint Site Collection to another on-prem 2013
// ASSUMPTIONS:
/*
CORS is configured for SharePoint to allow your base url i.e.: *.domain.net
https://stackoverflow.com/questions/33367758/enable-cors-in-sharepoint-2013
https://enable-cors.org/server_iis7.html
Fetch is used and polyfilled for IE
whatwg-fetch v3.0.0
Promises are used and polyfilled for IE
promise-polyfill 8.1.3
SharePoint is configured for JSONLite
@danawesome
danawesome / sharepoint-style.css
Last active June 23, 2020 00:20 — forked from wpsmith/sharepoint-style.css
CSS: Bootstrap fixes for SharePoint
/*bootstrap resets for SharePoint*/
/* the following might not be needed for you environment uncomment if needed*/
/*
#suiteBar *,
#suiteBar *:before,
#suiteBar *:after,
#s4-ribbonrow *,
#s4-ribbonrow *:before,
#s4-ribbonrow *:after {
-moz-box-sizing: content-box !important;