├── .vscode └── settings.json ├── LICENSE ├── README.md ├── images ├── FliCon.png ├── FlyView.png ├── Formatter.png ├── LookBook.png ├── Modern-SPO-Classess.png ├── SPSearchQueryTool.png ├── UI-Fabric-Theme-Designer.png ├── Untimate-list-Hugo.png ├── campljs.png ├── cisar.png ├── columnFormatter.png ├── generator-spfx.png ├── jsonViewer.png ├── modHeader.png ├── pnp-generator-spfx.png ├── sp-formatter.png ├── spGo .png ├── spGo.png ├── spInsider.png ├── speditor.png ├── sppp-generator.png └── sptyped-item.png ├── more-tools ├── README.md └── images │ ├── mockaroo.png │ └── xmlTree.png └── scripts ├── Azure Function App for webhook ├── Function App.cs ├── README.MD └── images │ ├── appSettings.png │ ├── appsecrets.png │ ├── binFolder.png │ ├── csomDll.png │ ├── functionApp.png │ ├── functionUrl.png │ ├── functionUrl.png.png │ ├── kudu.png │ ├── kuduPS.png │ ├── kuduSite.png │ ├── reigsterWebhook.png │ └── uploadeCsom.png ├── Cisar-CSR ├── README.md ├── images │ └── cisarStyles.png ├── pie-chart.css └── sample-styling.js ├── SP Editor ├── README.MD ├── assign-alternate-css.ts └── generate-test-data.ts ├── camljs-console ├── README.MD └── images │ ├── camljs-console-sample.png │ └── camljs-live-preview.png └── column-formatter ├── README.MD └── images └── columnFormatterSample.png /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "workbench.colorCustomizations": { 3 | "activityBar.background": "#65c89b", 4 | "activityBar.foreground": "#15202b", 5 | "activityBar.inactiveForeground": "#15202b99", 6 | "activityBarBadge.background": "#945bc4", 7 | "activityBarBadge.foreground": "#e7e7e7", 8 | "titleBar.activeBackground": "#42b883", 9 | "titleBar.inactiveBackground": "#42b88399", 10 | "titleBar.activeForeground": "#15202b", 11 | "titleBar.inactiveForeground": "#15202b99", 12 | "statusBar.background": "#42b883", 13 | "statusBarItem.hoverBackground": "#359268", 14 | "statusBar.foreground": "#15202b", 15 | "activityBar.activeBackground": "#65c89b", 16 | "activityBar.activeBorder": "#945bc4", 17 | "commandCenter.border": "#15202b99", 18 | "sash.hoverBorder": "#65c89b", 19 | "statusBarItem.remoteBackground": "#42b883", 20 | "statusBarItem.remoteForeground": "#15202b" 21 | }, 22 | "peacock.color": "#42b883" 23 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Denis Molodtsov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SharePoint productivity tools 2 | 3 | List of popular productivity tools for SharePoint. 4 | 5 | # List of Free Tools 6 | 7 | Sample scripts and files are also included in the [/scripts/ folder](/scripts/). 8 | 9 | 10 | ## Chrome extensions 11 | | Name | Image | Description 12 | | ---- | ----- | ------------------ | 13 | | [FlyView](https://chrome.google.com/webstore/detail/flyview-for-sharepoint-an/blmfdjjomajmejdkdbcabhgfonkhfaam) | ![](images/FlyView.png) | Explore SharePoint sites with this super-fast SharePoint navigation plugin, supports SharePoint Online (Office 365) and on-premises 14 | | [SP Insider](https://chrome.google.com/webstore/detail/sp-insider/gjckpigahcbffmeofjfedlffddhfidhj?hl=en) | ![](images/spInsider.png) | SP Insider (SPI) for Chrome is a free SharePoint Discovery tool for Developers and supports SharePoint Online/Office 365, 2016 and 2013. | 15 | | [Cisar](https://chrome.google.com/webstore/detail/cisar/nifbdojdggkboiifaklkamfpjcmgafpo?hl=en) | ![](images/cisar.png) | SharePoint CSR Live Edit. It makes process of creating SharePoint Client Side Rendering customizations many times faster. The customizations will be applied as-you-type to the underlying SharePoint page. | 16 | | [Caml JS Console](https://chrome.google.com/webstore/detail/camljs-console/ohjcpmdjfihchfhkmimcbklhjdphoeac?hl=en) | ![](images/campljs.png) | CamlJS Console with live preview. Free and open source development console for creating SharePoint CAML queries, with live preview against real lists and libraries. Uses CamlJs syntax. | 17 | | [SP Editor](https://chrome.google.com/webstore/detail/sp-editor/ecblfcmjnbbgaojblcpmjoamegpbodhd?hl=en) | ![](images/speditor.png) | This tool will help you create amazing SharePoint applications fast from your browser from any computer which runs Chrome! | 18 | | [SP Formatter](https://chrome.google.com/webstore/detail/sp-formatter/fmeihfaddhdkoogipahfcjlicglflkhg?hl=en) | ![](images/sp-formatter.png) | Chrome extension. Customize your SharePoint Column or View Formatting JSON using full-featured editor instead of default one. | 19 | | [ModHeader](https://chrome.google.com/webstore/detail/modheader/idgpnmonknjnojddfkpgkljpfnnfcklj?hl=en) | ![](images/modHeader.png) | Chrome extension. Use it to inject `Accept: application/json;odata=verbose` header. Forces SharePoint REST endpoints to return JSON instead of XML. Use it together with the [JSON Viewer](https://chrome.google.com/webstore/detail/json-viewer/gbmdgpbipfallnflgajpaliibnhdgobh) extension for the best effect. | 20 | | [JSON Viewer](https://chrome.google.com/webstore/detail/json-viewer/gbmdgpbipfallnflgajpaliibnhdgobh) | ![](images/jsonViewer.png) | Chrome extension. The most beautiful and customizable JSON/JSONP highlighter that your eyes have ever seen | 21 | 22 | 23 | ## SPFx webparts 24 | | Name | Image | Description 25 | | ---- | ----- | ------------------ | 26 | | [Column formatter](https://github.com/SharePoint/sp-dev-solutions/tree/master/solutions/ColumnFormatter) | ![](images/columnFormatter.png) | SPFx webpart. Full power of VS Code editing while providing easy to use templates and wizards all within the browser! The goal is to make writing and applying Column Formatting easier and quicker for both developers and end users. | 27 | 28 | 29 | 30 | ## Yeoman generators 31 | | Name | Image | Description 32 | | ---- | ----- | ------------------ | 33 | | [SPPP Generator](https://github.com/koltyakov/generator-sppp) | ![](images/sppp-generator.png) | Yeoman generator for SharePoint - lets you quickly set up a project with sensible defaults for pulling and pushing files between SharePoint asset library and local projects sources. | 34 | | [PnP SPFx generator](https://github.com/pnp/generator-spfx) | ![](images/pnp-generator-spfx.png) | This Yeoman generator provides improved governance for SharePoint Framework projects. It extends the out of the box Yeoman generator from Microsoft (@microsoft/generator-sharepoint) with recommended patterns and additional capabilities. | 35 | 36 | 37 | ## VS Code plugins 38 | | Name | Image | Description 39 | | ---- | ----- | ------------------ | 40 | | [SP Go](https://marketplace.visualstudio.com/items?itemName=SiteGo.spgo) | ![](images/spGo.png) | VS Code extension. Develop SharePoint web solutions from your local PC using the power of Visual Studio Code. Now you can build SharePoint sites and customizations source-control first with all of the power of a top-tier IDE. Produce cleaner code, deliver faster. | 41 | | [SharePoint Typed Item](https://marketplace.visualstudio.com/items?itemName=s-kainet.sharepoint-typed-item) | ![](images/sptyped-item.png) | VS Code extension. Generates TypeScript interfaces based on SharePoint data. A high quality, must-have extension developed by Sergei Sergeev. Quote from one of the users: "I followed the configuration steps and managed to get the extension working in a matter of minutes, having the ability to read/build the types directly from SharePoint.WOW, what a timesaver!!!!!!!!" | 42 | 43 | 44 | ## Windows apps 45 | | Name | Image | Description 46 | | ---- | ----- | ------------------ | 47 | | [SharePoint Search Query Tool](https://github.com/SharePoint/PnP-Tools/tree/master/Solutions/SharePoint.Search.QueryTool) | ![](images/SPSearchQueryTool.png) | Learn how to build an HTTP POST query, and how the different parameters should be formatted. | 48 | 49 | 50 | ## Online apps 51 | 52 | | Name | Image | Description 53 | | ---- | ----- | ------------------ | 54 | | [UI Fabric Theme Designer](https://fabricweb.z5.web.core.windows.net/pr-deploy-site/refs/pull/8933/merge/theming-designer/index.html) | ![](images/UI-Fabric-Theme-Designer.png)| By far the best way to generate modern Theme for SharePoint Online | 55 | | [Reusable SPO CSS classess](https://zerg00s.github.io/sp-modern-classes) | ![](images/Modern-SPO-Classess.png) | Reusable SharePoint Online CSS Classess for Modern UI. You can use it to develop column formatting customizations or your custom SPFx webparts. | 56 | | [SharePoint List Form Designer](https://form.challigan.com) | ![](./images/Formatter.png) | If you wish to customize the aesthetic of your SharePoint form without the usage of Power Apps, color coordination, icons, form field sections, and a footer can be added with ease. There is a free tool created by Carl Halligan that offers a visual demonstration of this process, which can be found at https://form.challigan.com | 57 | | [SharePoint Site Designer](https://www.sitedesigner.io) | ![](https://user-images.githubusercontent.com/2797648/170056563-ee710ab0-8ce2-4cd5-9126-6f16f5ff8563.png) | Visual browser-based tool by [David Go](https://github.com/site) for creating site scripts. This tool is amazing and really makes site scripts more accessible. | 58 | | [List Formatting Samples](https://pnp.github.io/List-Formatting)| ![](https://user-images.githubusercontent.com/2797648/170763813-d2b9e090-07e0-4c65-9ab0-ca9ba81f8f01.png)| You can use List Formatting to customize how fields and views in SharePoint lists and libraries are displayed. List Formatting is applied by constructing a JSON object that describes the elements that are displayed for a field or view and the styles to be applied to those elements. | 59 | | [HTML To Formatter](https://pnp.github.io/List-Formatting/tools/html-formatter-generator/)| image | Most developers are used to writing HTML rather than JSON. This tool can help building a formatter from a given HTML. You can even put in some CSS to get inline styles populated. This tool does not recognize expressions, but you can write expression strings in place of any attribute value and it will be put as-is on the generated JSON. | 60 | | [Flicon - Fluent UI Icon Search](https://www.flicon.io) | image | This tool is using icons from @fluentui The set of icons is always growing. | 61 | |[SharePoint look book](https://lookbook.microsoft.com/#templates)| image | Discover the modern experiences you can build with SharePoint in Microsoft 365. | 62 | 63 | 64 | ### Which tools should I use? 65 | 66 | | Old tool | Suggested alternative | 67 | | -------- | --------------------- | 68 | | SharePoint Designer 2013 | SP Editor, SP Go, SPPP Generator | 69 | | SharePoint Manager 2013 | SP Insider | 70 | | U2U Caml builder| Caml JS Console | 71 | 72 | 73 | ## Even more awesome tools 74 | ### Ultimate Developer Tool List for SPFx 75 | [![Ultimate list](images/Untimate-list-Hugo.png)](https://tahoeninjas.blog/2019/03/14/ultimate-developer-tool-list-for-spfx/) 76 | 77 | [Ultimate Developer Tool List for SPFx](https://tahoeninjas.blog/2019/03/14/ultimate-developer-tool-list-for-spfx/). Fantastic list of productivity tools by [Hugo Bernier, @bernierh](https://twitter.com/bernierh?lang=en). 78 | 79 | ### Other 80 | [Other, non-SharePoint tools](more-tools/RAEDME.md) 81 | -------------------------------------------------------------------------------- /images/FliCon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/FliCon.png -------------------------------------------------------------------------------- /images/FlyView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/FlyView.png -------------------------------------------------------------------------------- /images/Formatter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/Formatter.png -------------------------------------------------------------------------------- /images/LookBook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/LookBook.png -------------------------------------------------------------------------------- /images/Modern-SPO-Classess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/Modern-SPO-Classess.png -------------------------------------------------------------------------------- /images/SPSearchQueryTool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/SPSearchQueryTool.png -------------------------------------------------------------------------------- /images/UI-Fabric-Theme-Designer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/UI-Fabric-Theme-Designer.png -------------------------------------------------------------------------------- /images/Untimate-list-Hugo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/Untimate-list-Hugo.png -------------------------------------------------------------------------------- /images/campljs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/campljs.png -------------------------------------------------------------------------------- /images/cisar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/cisar.png -------------------------------------------------------------------------------- /images/columnFormatter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/columnFormatter.png -------------------------------------------------------------------------------- /images/generator-spfx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/generator-spfx.png -------------------------------------------------------------------------------- /images/jsonViewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/jsonViewer.png -------------------------------------------------------------------------------- /images/modHeader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/modHeader.png -------------------------------------------------------------------------------- /images/pnp-generator-spfx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/pnp-generator-spfx.png -------------------------------------------------------------------------------- /images/sp-formatter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/sp-formatter.png -------------------------------------------------------------------------------- /images/spGo .png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/spGo .png -------------------------------------------------------------------------------- /images/spGo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/spGo.png -------------------------------------------------------------------------------- /images/spInsider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/spInsider.png -------------------------------------------------------------------------------- /images/speditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/speditor.png -------------------------------------------------------------------------------- /images/sppp-generator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/sppp-generator.png -------------------------------------------------------------------------------- /images/sptyped-item.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/images/sptyped-item.png -------------------------------------------------------------------------------- /more-tools/README.md: -------------------------------------------------------------------------------- 1 | # Extra SharePoint produtivity tools 2 | 3 | What can I say? Here it goes a bigger list of tools for SharePoint 4 | 5 | --- 6 | ## List of Tools 7 | 8 | | Name | Image | Description 9 | | ---- | ----- | ------------------ | 10 | |[XML Tree](https://chrome.google.com/webstore/detail/xml-tree/gbammbheopgpmaagmckhpjbfgdfkpadb)| ![](images/xmlTree.png) | Displays XML data in a user friendly way. SharePoint REST API returns an XML by default. If for some reason, you are OK with XML and you want to make this XML user friendly - use [XML tree](https://chrome.google.com/webstore/detail/xml-tree/gbammbheopgpmaagmckhpjbfgdfkpadb). | 11 | | [Mockaroo](Mockaroo) | ![](images/mockaroo.png) | Generates realistic mock data in any popular format such as JSON or CSV. JSON format is excellent when you are using PnPjs or PowerShell PnP | 12 | 13 | -------------------------------------------------------------------------------- /more-tools/images/mockaroo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/more-tools/images/mockaroo.png -------------------------------------------------------------------------------- /more-tools/images/xmlTree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/more-tools/images/xmlTree.png -------------------------------------------------------------------------------- /scripts/Azure Function App for webhook/Function App.cs: -------------------------------------------------------------------------------- 1 | #r "Newtonsoft.Json" 2 | #r "Microsoft.WindowsAzure.Storage" 3 | #r "Microsoft.SharePoint.Client.Runtime.dll" 4 | #r "Microsoft.SharePoint.Client.dll" 5 | 6 | using System; 7 | using System.Net; 8 | using Newtonsoft.Json; 9 | using Microsoft.SharePoint.Client; 10 | using Microsoft.SharePoint.Client.Utilities; 11 | using Microsoft.WindowsAzure; 12 | using Microsoft.WindowsAzure.Storage; 13 | using Microsoft.WindowsAzure.Storage.Queue; 14 | public static async Task Run(HttpRequestMessage req, ILogger log) 15 | { 16 | //log.LogInformation($"Webhook was triggered!"); 17 | //await ConnectToSharePointAndSendEmail(log); 18 | string validationToken = req.GetQueryNameValuePairs().FirstOrDefault(q => string.Compare(q.Key, "validationtoken", true) == 0).Value; 19 | string message = req.GetQueryNameValuePairs().FirstOrDefault(q => string.Compare(q.Key, "message", true) == 0).Value; 20 | 21 | // This is just for registration: 22 | if (validationToken != null) 23 | { 24 | await ConnectToSharePointAndAddListItem(log, "webhook registered! " + message); 25 | log.LogInformation($"Validation token {validationToken} received"); 26 | var response = req.CreateResponse(HttpStatusCode.OK); 27 | response.Content = new StringContent(validationToken); 28 | return response; 29 | } 30 | // this is for normal runs: 31 | var content = await req.Content.ReadAsStringAsync(); 32 | log.LogInformation($"Received payload: {content}"); 33 | await ConnectToSharePointAndAddListItem(log, message); 34 | return new HttpResponseMessage(HttpStatusCode.OK); 35 | } 36 | public static async Task ConnectToSharePointAndAddListItem(ILogger log, string message) 37 | { 38 | string password = GetEnvironmentVariable("Password"); 39 | string login = GetEnvironmentVariable("Login"); 40 | System.Security.SecureString securePassword = new System.Security.SecureString(); 41 | foreach (char pass in password) 42 | { 43 | securePassword.AppendChar(pass); 44 | } 45 | SharePointOnlineCredentials spOnlineCredentials = new SharePointOnlineCredentials(login, securePassword); 46 | try 47 | { 48 | log.LogInformation($"Conneciton to SharePoint..."); 49 | using (var SPClientContext = new ClientContext("https://zergs.sharepoint.com/sites/demo")) 50 | { 51 | log.LogInformation($"[Success] Connected to SharePoint"); 52 | SPClientContext.Credentials = spOnlineCredentials; 53 | Web spWeb = SPClientContext.Site.RootWeb; 54 | List spList = spWeb.Lists.GetByTitle("AzureLog"); 55 | SPClientContext.Load(spList); 56 | SPClientContext.ExecuteQuery(); 57 | log.LogInformation($"[Success] spList items: {spList.Title}"); 58 | 59 | 60 | ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation(); 61 | ListItem oListItem = spList.AddItem(itemCreateInfo); 62 | oListItem["Title"] = message + " | " + DateTime.UtcNow.ToLongTimeString(); 63 | 64 | oListItem.Update(); 65 | SPClientContext.ExecuteQuery(); 66 | 67 | 68 | } 69 | } 70 | catch (Exception ex) 71 | { 72 | log.LogInformation($"Azure Function Exception: {ex.Message}"); 73 | } 74 | return true; 75 | } 76 | 77 | 78 | public static string GetEnvironmentVariable(string name) 79 | { 80 | return System.Environment.GetEnvironmentVariable(name, EnvironmentVariableTarget.Process); 81 | } -------------------------------------------------------------------------------- /scripts/Azure Function App for webhook/README.MD: -------------------------------------------------------------------------------- 1 | # Instrcutions: Creating an Azure function that is called from SharePoint list. 2 | 3 | 4 | 5 | ## Important warning: Azure function V2 does not support SharePoint CSOM. 6 | 7 | Azure functions V2 use .net core that is not compatible with SharePoint CSOM libraries. This is why we need to make sure Azure function is using the older, V1 version. 8 | 9 | You can only change the runtime version to V1 after you create your function app but before you add any functions. To learn how to pin the runtime version to 1.x, see [View and update the current runtime version](https://docs.microsoft.com/en-us/azure/azure-functions/set-runtime-version#view-and-update-the-current-runtime-version).x 10 | 11 | ![](images/functionApp.png) 12 | 13 | 14 | 15 | ## About creating azure functions. 16 | 17 | Remember to switch your Azure Function App to V1. 18 | - [How to create a SharePoint webhook that will call an Azure function](https://docs.microsoft.com/en-us/sharepoint/dev/apis/webhooks/sharepoint-webhooks-using-azure-functions) 19 | - [Azure function that creates SharePoint List items via CSOM](https://social.technet.microsoft.com/wiki/contents/articles/38062.sharepoint-online-simulate-sharepoint-timer-jobs-and-event-receivers-using-azure-functions-and-sharepoint-webhooks.aspx) 20 | 21 | 22 | 23 | ## Storing Azure Function's secrepts in the application settings 24 | 25 | - Navigate to the Azure Function App's Application settings. 26 | - Add any secrets you need. In our case, we added Login and Password: 27 | 28 | ![](images/appSettings.png) 29 | 30 | ![](images/appsecrets.png) 31 | 32 | Now you can access your secrets from your C# Azurure Function: 33 | ```cs 34 | // Helper method for retrieving the app secrets 35 | public static string GetEnvironmentVariable(string name) 36 | { 37 | return System.Environment.GetEnvironmentVariable(name, EnvironmentVariableTarget.Process); 38 | } 39 | 40 | // Retrieve app secrets: 41 | string login = GetEnvironmentVariable("Login"); 42 | string password = GetEnvironmentVariable("Password"); 43 | ``` 44 | 45 | 46 | ## Upload SharePoint CSOM libraries to Azure function 47 | In order to use SharePoint CSOM libraries from Azure functions, you need need to 48 | - Use Azure Function App V1 model 49 | - Upload CSOM client libraries to your Azure function: 50 | 51 | ![](images/uploadeCsom.png) 52 | 53 | ### Uploading CSOM libraries using Kudu tool 54 | 55 | ![](images/kudu.png) 56 | 57 | 58 | ![](images/kuduPS.png) 59 | 60 | 61 | It will open the folder structure. We must navigate to the site –> wwwroot –>  location 62 | 63 | 64 | ![](images/kuduSite.png) 65 | 66 | In this case, function name is `ExpiredSLAIdenitifier`. Click on the folder to go inside the folder where we will create a new `\bin` folder. 67 | 68 | ![](images/binFolder.png) 69 | 70 | For SharePoint operations, Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll files are required. Simply drag and drop these .dll's to the `\bin` folder: 71 | 72 | 73 | images/csomDll![](images/csomDll.png) 74 | 75 | 76 | ## Sample Azure function code that uses CSOM to create SharePoint list items 77 | ```cs 78 | #r "Newtonsoft.Json" 79 | #r "Microsoft.WindowsAzure.Storage" 80 | #r "Microsoft.SharePoint.Client.Runtime.dll" 81 | #r "Microsoft.SharePoint.Client.dll" 82 | 83 | using System; 84 | using System.Net; 85 | using Newtonsoft.Json; 86 | using Microsoft.SharePoint.Client; 87 | using Microsoft.SharePoint.Client.Utilities; 88 | using Microsoft.WindowsAzure; 89 | using Microsoft.WindowsAzure.Storage; 90 | using Microsoft.WindowsAzure.Storage.Queue; 91 | public static async Task Run(HttpRequestMessage req, ILogger log) 92 | { 93 | //log.LogInformation($"Webhook was triggered!"); 94 | //await ConnectToSharePointAndSendEmail(log); 95 | string validationToken = req.GetQueryNameValuePairs().FirstOrDefault(q Instrcutions to create an Azure function=> string.Compare(q.Key, "validationtoken", true) == 0).Value; 96 | string message = req.GetQueryNameValuePairs().FirstOrDefault(q => string.Compare(q.Key, "message", true) == 0).Value; 97 | 98 | // This is just for registration: 99 | if (validationToken != null) 100 | { 101 | await ConnectToSharePointAndAddListItem(log, "webhook registered! " + message); 102 | log.LogInformation($"Validation token {validationToken} received"); 103 | var response = req.CreateResponse(HttpStatusCode.OK); 104 | response.Content = new StringContent(validationToken); 105 | return response; 106 | } 107 | // this is for normal runs: 108 | var content = await req.Content.ReadAsStringAsync(); 109 | log.LogInformation($"Received payload: {content}"); 110 | await ConnectToSharePointAndAddListItem(log, message); 111 | return new HttpResponseMessage(HttpStatusCode.OK); 112 | } 113 | public static async Task ConnectToSharePointAndAddListItem(ILogger log, string message) 114 | { 115 | string password = GetEnvironmentVariable("Password"); 116 | string login = GetEnvironmentVariable("Login"); 117 | System.Security.SecureString securePassword = new System.Security.SecureString(); 118 | foreach (char pass in password) 119 | { 120 | securePassword.AppendChar(pass); 121 | } 122 | SharePointOnlineCredentials spOnlineCredentials = new SharePointOnlineCredentials(login, securePassword); 123 | try 124 | { 125 | log.LogInformation($"Conneciton to SharePoint..."); 126 | using (var SPClientContext = new ClientContext("https://zergs.sharepoint.com/sites/demo")) 127 | { 128 | log.LogInformation($"[Success] Connected to SharePoint"); 129 | SPClientContext.Credentials = spOnlineCredentials; 130 | Web spWeb = SPClientContext.Site.RootWeb; 131 | List spList = spWeb.Lists.GetByTitle("AzureLog"); 132 | SPClientContext.Load(spList); 133 | SPClientContext.ExecuteQuery(); 134 | log.LogInformation($"[Success] spList items: {spList.Title}"); 135 | 136 | 137 | ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation(); 138 | ListItem oListItem = spList.AddItem(itemCreateInfo); 139 | oListItem["Title"] = message + " | " + DateTime.UtcNow.ToLongTimeString(); 140 | 141 | oListItem.Update(); 142 | SPClientContext.ExecuteQuery(); 143 | 144 | 145 | } 146 | } 147 | catch (Exception ex) 148 | { 149 | log.LogInformation($"Azure Function Exception: {ex.Message}"); 150 | } 151 | return true; 152 | } 153 | 154 | 155 | public static string GetEnvironmentVariable(string name) 156 | { 157 | return System.Environment.GetEnvironmentVariable(name, EnvironmentVariableTarget.Process); 158 | } 159 | 160 | ``` 161 | 162 | 163 | ## Register web hook using SP Editor 164 | - Click on Get function URL: 165 | ![](images/functionUrl.png.png) 166 | - Open SharePoint site 167 | - Click F12 168 | - Click on the "SharePoint" tab 169 | - Webhooks 170 | - Select SharePoint list you want to use. It will automatically call your Azure function every time thee is a change in the list 171 | - Paste the Azure function URL and press Add: 172 | 173 | ![](images/reigsterWebhook.png) 174 | -------------------------------------------------------------------------------- /scripts/Azure Function App for webhook/images/appSettings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/scripts/Azure Function App for webhook/images/appSettings.png -------------------------------------------------------------------------------- /scripts/Azure Function App for webhook/images/appsecrets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/scripts/Azure Function App for webhook/images/appsecrets.png -------------------------------------------------------------------------------- /scripts/Azure Function App for webhook/images/binFolder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/scripts/Azure Function App for webhook/images/binFolder.png -------------------------------------------------------------------------------- /scripts/Azure Function App for webhook/images/csomDll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/scripts/Azure Function App for webhook/images/csomDll.png -------------------------------------------------------------------------------- /scripts/Azure Function App for webhook/images/functionApp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/scripts/Azure Function App for webhook/images/functionApp.png -------------------------------------------------------------------------------- /scripts/Azure Function App for webhook/images/functionUrl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/scripts/Azure Function App for webhook/images/functionUrl.png -------------------------------------------------------------------------------- /scripts/Azure Function App for webhook/images/functionUrl.png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/scripts/Azure Function App for webhook/images/functionUrl.png.png -------------------------------------------------------------------------------- /scripts/Azure Function App for webhook/images/kudu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/scripts/Azure Function App for webhook/images/kudu.png -------------------------------------------------------------------------------- /scripts/Azure Function App for webhook/images/kuduPS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/scripts/Azure Function App for webhook/images/kuduPS.png -------------------------------------------------------------------------------- /scripts/Azure Function App for webhook/images/kuduSite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/scripts/Azure Function App for webhook/images/kuduSite.png -------------------------------------------------------------------------------- /scripts/Azure Function App for webhook/images/reigsterWebhook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/scripts/Azure Function App for webhook/images/reigsterWebhook.png -------------------------------------------------------------------------------- /scripts/Azure Function App for webhook/images/uploadeCsom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/scripts/Azure Function App for webhook/images/uploadeCsom.png -------------------------------------------------------------------------------- /scripts/Cisar-CSR/README.md: -------------------------------------------------------------------------------- 1 | # Cisar. Chrome extension. Samples and code snippets 2 | 3 | ![](images/cisarStyles.png) 4 | 5 | ### Styling the list view form using JSLink and Cisar 6 | ```js 7 | SP.SOD.executeFunc("clienttemplates.js", "SPClientTemplates", function () { 8 | 9 | function getBaseHtml(ctx) { 10 | return SPClientTemplates["_defaultTemplates"].Fields.default.all.all[ctx.CurrentFieldSchema.FieldType][ctx.BaseViewID](ctx); 11 | } 12 | function init() { 13 | SPClientTemplates.TemplateManager.RegisterTemplateOverrides({ 14 | Templates: { 15 | Fields: { 16 | "Skill": { 17 | View: function (ctx) { 18 | return `
${ctx.CurrentItem[ctx.CurrentFieldSchema.Name]}%
` 19 | } 20 | }, 21 | "Grade": { 22 | View: function (ctx) { 23 | 24 | return `
${ctx.CurrentItem[ctx.CurrentFieldSchema.Name]}
` 25 | }, 26 | }, 27 | "Expert": { 28 | View: function (ctx) { 29 | if (ctx.CurrentItem[ctx.CurrentFieldSchema.Name] === 'Yes'){ 30 | return `` 31 | }else{ 32 | return `` 33 | } 34 | 35 | }, 36 | } 37 | }, 38 | }, 39 | ListTemplateType: 100 40 | }); 41 | } 42 | 43 | RegisterModuleInit(SPClientTemplates.Utility.ReplaceUrlTokens("~siteCollection/Style Library/Users.js"), init); 44 | init(); 45 | 46 | }); 47 | 48 | 49 | ``` 50 | 51 | ### Styling the pie charts: 52 | 53 | ```css 54 | .pieContainer { 55 | height: 40px; 56 | margin-left: 5px; 57 | position: relative; 58 | } 59 | 60 | .pieBackground { 61 | position: absolute; 62 | width: 40px; 63 | height: 40px; 64 | border-radius: 20px; 65 | box-shadow: 0px 0px 8px rgba(0,0,0,0.5); 66 | } 67 | 68 | .pie { 69 | transition: all 1s; 70 | position: absolute; 71 | width: 40px; 72 | height: 40px; 73 | border-radius: 22px; 74 | clip: rect(0px, 22px, 40px, 0px); 75 | } 76 | 77 | .hold { 78 | position: absolute; 79 | width: 40px; 80 | height: 40px; 81 | border-radius: 22px; 82 | clip: rect(0px, 40px, 40px, 22px); 83 | } 84 | 85 | #pieSlice1 .pie { 86 | background-color: #1b458b; 87 | transform:rotate(5deg); 88 | } 89 | 90 | #pieSlice2 .pie { 91 | background-color: #1b458b; 92 | transform:rotate(50deg); 93 | } 94 | 95 | #pieSlice3 .pie { 96 | background-color: #1b458b; 97 | transform:rotate(70deg); 98 | } 99 | #pieSlice4 .pie { 100 | background-color: #1b458b; 101 | transform:rotate(90deg); 102 | } 103 | #pieSlice5 .pie { 104 | background-color: #1b458b; 105 | transform:rotate(120deg); 106 | } 107 | #pieSlice6 .pie { 108 | background-color: #1b458b; 109 | transform:rotate(160deg); 110 | } 111 | #pieSlice7 .pie { 112 | background-color: #1b458b; 113 | transform:rotate(180deg); 114 | } 115 | #pieSlice8 .pie { 116 | background-color: #1b458b; 117 | transform:rotate(180deg); 118 | } 119 | #pieSlice9 .pie { 120 | background-color: #1b458b; 121 | transform:rotate(180deg); 122 | } 123 | 124 | 125 | .innerCircle { 126 | position: absolute; 127 | width: 20px; 128 | height: 20px; 129 | background-color: #888; 130 | border-radius: 30px; 131 | top: 10px; 132 | left: 10px; 133 | box-shadow: 0px 0px 8px rgba(0,0,0,0.5) inset; 134 | color: white; 135 | } 136 | .innerCircle .content { 137 | position: absolute; 138 | display: block; 139 | width: 20px; 140 | top: 5px; 141 | left: 0; 142 | text-align: center; 143 | font-size: 8px; 144 | color: black 145 | } 146 | 147 | 148 | ``` -------------------------------------------------------------------------------- /scripts/Cisar-CSR/images/cisarStyles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/scripts/Cisar-CSR/images/cisarStyles.png -------------------------------------------------------------------------------- /scripts/Cisar-CSR/pie-chart.css: -------------------------------------------------------------------------------- 1 | .pieContainer { 2 | height: 40px; 3 | margin-left: 5px; 4 | position: relative; 5 | } 6 | 7 | .pieBackground { 8 | position: absolute; 9 | width: 40px; 10 | height: 40px; 11 | border-radius: 20px; 12 | box-shadow: 0px 0px 8px rgba(0,0,0,0.5); 13 | } 14 | 15 | .pie { 16 | transition: all 1s; 17 | position: absolute; 18 | width: 40px; 19 | height: 40px; 20 | border-radius: 22px; 21 | clip: rect(0px, 22px, 40px, 0px); 22 | } 23 | 24 | .hold { 25 | position: absolute; 26 | width: 40px; 27 | height: 40px; 28 | border-radius: 22px; 29 | clip: rect(0px, 40px, 40px, 22px); 30 | } 31 | 32 | #pieSlice1 .pie { 33 | background-color: #1b458b; 34 | transform:rotate(5deg); 35 | } 36 | 37 | #pieSlice2 .pie { 38 | background-color: #1b458b; 39 | transform:rotate(50deg); 40 | } 41 | 42 | #pieSlice3 .pie { 43 | background-color: #1b458b; 44 | transform:rotate(70deg); 45 | } 46 | #pieSlice4 .pie { 47 | background-color: #1b458b; 48 | transform:rotate(90deg); 49 | } 50 | #pieSlice5 .pie { 51 | background-color: #1b458b; 52 | transform:rotate(120deg); 53 | } 54 | #pieSlice6 .pie { 55 | background-color: #1b458b; 56 | transform:rotate(160deg); 57 | } 58 | #pieSlice7 .pie { 59 | background-color: #1b458b; 60 | transform:rotate(180deg); 61 | } 62 | #pieSlice8 .pie { 63 | background-color: #1b458b; 64 | transform:rotate(180deg); 65 | } 66 | #pieSlice9 .pie { 67 | background-color: #1b458b; 68 | transform:rotate(180deg); 69 | } 70 | 71 | 72 | .innerCircle { 73 | position: absolute; 74 | width: 20px; 75 | height: 20px; 76 | background-color: #888; 77 | border-radius: 30px; 78 | top: 10px; 79 | left: 10px; 80 | box-shadow: 0px 0px 8px rgba(0,0,0,0.5) inset; 81 | color: white; 82 | } 83 | .innerCircle .content { 84 | position: absolute; 85 | display: block; 86 | width: 20px; 87 | top: 5px; 88 | left: 0; 89 | text-align: center; 90 | font-size: 8px; 91 | color: black 92 | } 93 | 94 | -------------------------------------------------------------------------------- /scripts/Cisar-CSR/sample-styling.js: -------------------------------------------------------------------------------- 1 | SP.SOD.executeFunc("clienttemplates.js", "SPClientTemplates", function () { 2 | 3 | function getBaseHtml(ctx) { 4 | return SPClientTemplates["_defaultTemplates"].Fields.default.all.all[ctx.CurrentFieldSchema.FieldType][ctx.BaseViewID](ctx); 5 | } 6 | function init() { 7 | SPClientTemplates.TemplateManager.RegisterTemplateOverrides({ 8 | Templates: { 9 | Fields: { 10 | "Skill": { 11 | View: function (ctx) { 12 | return `
${ctx.CurrentItem[ctx.CurrentFieldSchema.Name]}%
` 13 | } 14 | }, 15 | "Grade": { 16 | View: function (ctx) { 17 | //console.log(ctx.CurrentItem[ctx.CurrentFieldSchema.Name], ctx.CurrentFieldSchema.Name); 18 | 19 | return `
${ctx.CurrentItem[ctx.CurrentFieldSchema.Name]}
` 20 | }, 21 | }, 22 | "Expert": { 23 | View: function (ctx) { 24 | //console.log(ctx.CurrentItem[ctx.CurrentFieldSchema.Name], ctx.CurrentFieldSchema.Name); 25 | if (ctx.CurrentItem[ctx.CurrentFieldSchema.Name] === 'Yes'){ 26 | return `` 27 | }else{ 28 | return `` 29 | } 30 | 31 | }, 32 | } 33 | }, 34 | }, 35 | ListTemplateType: 100 36 | }); 37 | } 38 | 39 | RegisterModuleInit(SPClientTemplates.Utility.ReplaceUrlTokens("~siteCollection/Style Library/Users.js"), init); 40 | init(); 41 | 42 | }); 43 | -------------------------------------------------------------------------------- /scripts/SP Editor/README.MD: -------------------------------------------------------------------------------- 1 | # SP Editor. Samples and code snippets 2 | 3 | ### Set Alternate CSS. Simple way 4 | ```cs 5 | // Adding Alternate CSS to the web site: 6 | import { sp } from "@pnp/sp"; 7 | 8 | sp.web.update({ 9 | AlternateCssUrl: _spPageContextInfo.siteServerRelativeUrl + "/Style Library/global.css" 10 | }); 11 | 12 | ``` 13 | 14 | ### Set Alternate CSS. Addition checks: 15 | ```js 16 | // Same example as before, but with additional checks. 17 | // applying global.css file to the web.AlternateCssUrl using PnpJs: 18 | import { sp } from "@pnp/sp"; 19 | 20 | async function Main() { 21 | 22 | let list = await sp.web.lists.getByTitle("Style Library"); 23 | let items: any[] = await list.items.select("LinkFilename").getAll(); 24 | items = items.map(item => item.LinkFilename); 25 | if (items.includes("global.css")) { 26 | await sp.web.update({ 27 | AlternateCssUrl: _spPageContextInfo.siteServerRelativeUrl + "/Style Library/global.css" 28 | }); 29 | } else { 30 | alert('global.css does not exist in the Style Library!'); 31 | } 32 | } 33 | 34 | Main(); 35 | ``` 36 | 37 | ### Create a sample list of users and populates it with data 38 | ```js 39 | // demonstrates the power of the SP Editor chrome extension 40 | // creates a sample list of users and populates it with data 41 | 42 | // warning: make sure this script is running when console is enabled. 43 | // othwerwise, it might fail to create the data: 44 | import { sp } from "@pnp/sp"; 45 | 46 | let lists = sp.web.lists; 47 | let listName = "Users"; 48 | let list = sp.web.lists.getByTitle(listName); 49 | async function Main() { 50 | 51 | let filteredLists: any[] = await lists.filter("Title eq '" + listName + "'").get(); 52 | if (filteredLists.length > 0) { 53 | await list.delete(); 54 | console.log(listName + " deleted"); 55 | } 56 | await lists.add(listName); 57 | console.log(listName + " created"); 58 | 59 | await list.fields.addNumber("Skill"); 60 | await list.fields.addBoolean("Expert"); 61 | await list.fields.addNumber("Grade"); 62 | console.info("columns added"); 63 | 64 | // display all columns in the defailt view: 65 | const view = list.defaultView; 66 | const batch = sp.web.createBatch(); 67 | const fields = ['ID', 'LinkTitle', 'Skill', 'Expert', 'Grade', 'Created', 'Editor', 'Modified']; 68 | view.fields.inBatch(batch).removeAll(); 69 | fields.forEach(fieldName => { 70 | view.fields.inBatch(batch).add(fieldName); 71 | }); 72 | await batch.execute(); 73 | console.log("defailt view modified"); 74 | 75 | // get mock data from the mockaroo service: 76 | let response = await fetch("https://api.mockaroo.com/api/generate.json?key=fc5788f0&schema=Users"); 77 | let users = await response.json(); 78 | 79 | // add mock data to the list: 80 | let entityTypeFullName = await list.getListItemEntityTypeFullName(); 81 | let itemsBatch = sp.web.createBatch(); 82 | for (var i = 0; i < users.length; i++) { 83 | list.items.inBatch(itemsBatch).add(users[i], entityTypeFullName); 84 | } 85 | 86 | await itemsBatch.execute(); 87 | console.log("items added!"); 88 | } 89 | 90 | Main(); 91 | 92 | ``` -------------------------------------------------------------------------------- /scripts/SP Editor/assign-alternate-css.ts: -------------------------------------------------------------------------------- 1 | import { sp } from "@pnp/sp"; 2 | 3 | sp.web.update({ 4 | AlternateCssUrl: _spPageContextInfo.siteServerRelativeUrl + "/Style Library/global.css" 5 | }); 6 | -------------------------------------------------------------------------------- /scripts/SP Editor/generate-test-data.ts: -------------------------------------------------------------------------------- 1 | // demonstrates the power of the SP Editor chrome extension 2 | // creates a sample list of users and populates it with data 3 | 4 | // warning: make sure this script is running when console is enabled. 5 | // othwerwise, it might fail to create the data: 6 | import { sp } from "@pnp/sp"; 7 | 8 | let lists = sp.web.lists; 9 | let listName = "Users"; 10 | let list = sp.web.lists.getByTitle(listName); 11 | async function Main() { 12 | 13 | let filteredLists: any[] = await lists.filter("Title eq '" + listName + "'").get(); 14 | if (filteredLists.length > 0) { 15 | await list.delete(); 16 | console.log(listName + " deleted"); 17 | } 18 | await lists.add(listName); 19 | console.log(listName + " created"); 20 | 21 | await list.fields.addNumber("Skill"); 22 | await list.fields.addBoolean("Expert"); 23 | await list.fields.addNumber("Grade"); 24 | console.info("columns added"); 25 | 26 | // display all columns in the defailt view: 27 | const view = list.defaultView; 28 | const batch = sp.web.createBatch(); 29 | const fields = ['ID', 'LinkTitle', 'Skill', 'Expert', 'Grade', 'Created', 'Editor', 'Modified']; 30 | view.fields.inBatch(batch).removeAll(); 31 | fields.forEach(fieldName => { 32 | view.fields.inBatch(batch).add(fieldName); 33 | }); 34 | await batch.execute(); 35 | console.log("defailt view modified"); 36 | 37 | // get mock data from the mockaroo service: 38 | let response = await fetch("https://api.mockaroo.com/api/generate.json?key=fc5788f0&schema=Users"); 39 | let users = await response.json(); 40 | 41 | // add mock data to the list: 42 | let entityTypeFullName = await list.getListItemEntityTypeFullName(); 43 | let itemsBatch = sp.web.createBatch(); 44 | for (var i = 0; i < users.length; i++) { 45 | list.items.inBatch(itemsBatch).add(users[i], entityTypeFullName); 46 | } 47 | 48 | await itemsBatch.execute(); 49 | console.log("items added!"); 50 | } 51 | 52 | Main(); 53 | -------------------------------------------------------------------------------- /scripts/camljs-console/README.MD: -------------------------------------------------------------------------------- 1 | # [CamlJs console](https://chrome.google.com/webstore/detail/camljs-console/ohjcpmdjfihchfhkmimcbklhjdphoeac/related?hl=en). Samples and code snippets 2 | 3 | ![](images/camljs-live-preview.png) 4 | 5 | ### Selecting items where skill > 60 6 | ```js 7 | var query = new CamlBuilder().Where().NumberField("Skill").GreaterThan(60).ToString() 8 | ``` 9 | 10 | ![](images/camljs-console-sample.png) 11 | 12 | 13 | ### Selecting all items where expert is true 14 | ```js 15 | var query = new CamlBuilder().Where().BooleanField("Expert").EqualTo(true).ToString() 16 | ``` 17 | -------------------------------------------------------------------------------- /scripts/camljs-console/images/camljs-console-sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/scripts/camljs-console/images/camljs-console-sample.png -------------------------------------------------------------------------------- /scripts/camljs-console/images/camljs-live-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/scripts/camljs-console/images/camljs-live-preview.png -------------------------------------------------------------------------------- /scripts/column-formatter/README.MD: -------------------------------------------------------------------------------- 1 | # [Column formatter](https://github.com/SharePoint/sp-dev-solutions/tree/master/solutions/ColumnFormatter). Samples and code snippets 2 | 3 | 4 | ![](images/columnFormatterSample.png) 5 | 6 | ### Skill - bar chart 7 | ```json 8 | { 9 | "$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json", 10 | "elmType": "div", 11 | "txtContent": { 12 | "operator": "+", 13 | "operands": [ 14 | { 15 | "operator": "toString()", 16 | "operands": [ 17 | { 18 | "operator": "*", 19 | "operands": [ 20 | 1, 21 | { 22 | "operator": "-", 23 | "operands":[ 24 | "@currentField", 25 | 0 26 | ] 27 | } 28 | ] 29 | } 30 | ] 31 | }, 32 | " %" 33 | ] 34 | }, 35 | "attributes": { 36 | "class": "sp-field-dataBars" 37 | }, 38 | "style": { 39 | "width": { 40 | "operator": "?", 41 | "operands": [ 42 | { 43 | "operator": ">", 44 | "operands": [ 45 | "@currentField", 46 | 100 47 | ] 48 | }, 49 | "100%", 50 | { 51 | "operator": "?", 52 | "operands": [ 53 | { 54 | "operator": "<", 55 | "operands": [ 56 | "@currentField", 57 | 0 58 | ] 59 | }, 60 | "0", 61 | { 62 | "operator": "+", 63 | "operands": [ 64 | { 65 | "operator": "toString()", 66 | "operands": [ 67 | { 68 | "operator": "*", 69 | "operands": [ 70 | 1, 71 | { 72 | "operator": "-", 73 | "operands":[ 74 | "@currentField", 75 | 0 76 | ] 77 | } 78 | ] 79 | } 80 | ] 81 | }, 82 | "%" 83 | ] 84 | } 85 | ] 86 | } 87 | ] 88 | } 89 | } 90 | } 91 | ``` 92 | 93 | ### Exporet: yes/no column 94 | 95 | ```json 96 | { 97 | "$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json", 98 | "elmType": "div", 99 | "attributes": { 100 | "iconName": { 101 | "operator": "?", 102 | "operands": [ 103 | "@currentField", 104 | "CheckboxComposite", 105 | "Checkbox" 106 | ] 107 | } 108 | }, 109 | "style": { 110 | "font-size":"large", 111 | "color":"black" 112 | } 113 | } 114 | 115 | ``` 116 | 117 | ### Grade: pie chart 118 | ```json 119 | { 120 | "$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json", 121 | "elmType": "div", 122 | "style": { 123 | "padding": "4px", 124 | "height": "42px", 125 | "width": "42px" 126 | }, 127 | "children": [ 128 | { 129 | "elmType": "div", 130 | "style": { 131 | "display": "inline-block", 132 | "background-color": "#c8c8c8", 133 | "border-radius": "100%", 134 | "fill": "#008272", 135 | "width": "42px", 136 | "height": "42px", 137 | "position": "absolute" 138 | }, 139 | "children": [ 140 | { 141 | "elmType": "svg", 142 | "children": [ 143 | { 144 | "elmType": "path", 145 | "attributes": { 146 | "d": { 147 | "operator": "+", 148 | "operands": [ 149 | "M21,21 L21,0, A21,21 0 ", 150 | { 151 | "operator": ":", 152 | "operands": [ 153 | { 154 | "operator": "<=", 155 | "operands": [ 156 | "@currentField", 157 | 3.5 158 | ] 159 | }, 160 | "0", 161 | "1" 162 | ] 163 | }, 164 | ",1 ", 165 | { 166 | "operator": "toString()", 167 | "operands": [ 168 | { 169 | "operator": "+", 170 | "operands": [ 171 | 21, 172 | { 173 | "operator": "*", 174 | "operands": [ 175 | { 176 | "operator": "sin", 177 | "operands": [ 178 | { 179 | "operator": "*", 180 | "operands": [ 181 | 6.2831853, 182 | { 183 | "operator": "/", 184 | "operands": [ 185 | { 186 | "operator": "-", 187 | "operands": [ 188 | { 189 | "operator": "?", 190 | "operands": [ 191 | { 192 | "operator": ">=", 193 | "operands": [ 194 | "@currentField", 195 | 7 196 | ] 197 | }, 198 | 6.9999, 199 | { 200 | "operator": "?", 201 | "operands": [ 202 | { 203 | "operator": "<", 204 | "operands": [ 205 | "@currentField", 206 | 0 207 | ] 208 | }, 209 | 0, 210 | "@currentField" 211 | ] 212 | } 213 | ] 214 | }, 215 | 0 216 | ] 217 | }, 218 | 7 219 | ] 220 | } 221 | ] 222 | } 223 | ] 224 | }, 225 | 21 226 | ] 227 | } 228 | ] 229 | } 230 | ] 231 | }, 232 | ",", 233 | { 234 | "operator": "toString()", 235 | "operands": [ 236 | { 237 | "operator": "-", 238 | "operands": [ 239 | 21, 240 | { 241 | "operator": "*", 242 | "operands": [ 243 | { 244 | "operator": "cos", 245 | "operands": [ 246 | { 247 | "operator": "*", 248 | "operands": [ 249 | 6.2831853, 250 | { 251 | "operator": "/", 252 | "operands": [ 253 | { 254 | "operator": "-", 255 | "operands": [ 256 | { 257 | "operator": "?", 258 | "operands": [ 259 | { 260 | "operator": ">=", 261 | "operands": [ 262 | "@currentField", 263 | 7 264 | ] 265 | }, 266 | 6.9999, 267 | { 268 | "operator": "?", 269 | "operands": [ 270 | { 271 | "operator": "<", 272 | "operands": [ 273 | "@currentField", 274 | 0 275 | ] 276 | }, 277 | 0, 278 | "@currentField" 279 | ] 280 | } 281 | ] 282 | }, 283 | 0 284 | ] 285 | }, 286 | 7 287 | ] 288 | } 289 | ] 290 | } 291 | ] 292 | }, 293 | 21 294 | ] 295 | } 296 | ] 297 | } 298 | ] 299 | }, 300 | " z" 301 | ] 302 | } 303 | } 304 | } 305 | ] 306 | } 307 | ] 308 | }, 309 | { 310 | "elmType": "div", 311 | "style": { 312 | "background-color": "white", 313 | "position": "relative", 314 | "width": "21px", 315 | "height": "21px", 316 | "top": "0px", 317 | "left": "10.5px", 318 | "border-radius": "100%", 319 | "text-align": "center" 320 | }, 321 | "children": [ 322 | { 323 | "elmType": "div", 324 | "txtContent": "@currentField", 325 | "style": { 326 | "position": "relative", 327 | "text-align": "center", 328 | "width": "42px", 329 | "display": "inline", 330 | "line-height":"21px", 331 | "font-size":"8.4px" 332 | } 333 | } 334 | ] 335 | } 336 | ] 337 | } 338 | 339 | ``` -------------------------------------------------------------------------------- /scripts/column-formatter/images/columnFormatterSample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zerg00s/productivity-tools/351327ee6042b7a9f2143cc4fb30bfd0d03e1479/scripts/column-formatter/images/columnFormatterSample.png --------------------------------------------------------------------------------