Create folder in list using workflow

For workflow being able to create folders, you need to assign the folder content type to the list and then create new item from workflow using folder content type.

Add folder content type in list

  1. Open the list in an internet browser. There will be an option bar at the top.
  2. Select “List” and choose “List Settings” in the new ribbon.
  3. Click on “Advanced Settings”, activate the option “Enable management of content types” and click on “OK”.
  4. Back to the list settings.
  5. Click on “Add from existing content types”.
  6. In the new page, select “Folder Content Type” from the dropdown menu.
  7. Add the content type named “Folder” to the list content types by selecting it and clicking on the arrow pointing to the right.
  8. Click on “OK” to save the new assignment.


Now folder content type is added in list. Now create workflow on list which will create folder in list

Create folder using workflow

  1. To create a folder, choose the action “Create a list item”.
  2. Click on action to fill more information.
  3. Choose the list where the folder shall be added from the dropdown field.
  4. If your list has multiple content types, a field to assign a value to, will automatically be added. It is called “Content Type ID”. If it is not present, click on “Add” to add this field.
  5. Select “folder” from dropdown.
  6. Set title field for folder name.


Now your folder will be create through workflow. Folder can also create in document library through workflow by same procedure.


URL & Locations in SharePoint

In this blog i am sharing some important URLs and Locations in SharePoint which can help developer as well as administrator to access resources easily.


1. Sign in as a different user

2. Change Site Master Page

3. Page Layouts and Site Templates

4. User Information List:

5. Sandboxed Solution Gallery:

6. All site content page (Site content):

7. Site settings page:

8. Site collection features(CASE SENSITIVE):

9. Site features:

10. Get the version of the SharePoint server (Patch level):

11. Web Part Maintenance Page:

12. Save Site as a template

13. Master Pages library

14. Master Page Gallery

15. Site Column Gallery

16. Site Content Types

17. Managed Metadata (Subset used terms on site) -Added by DAMIAN

18. Test Sample Page (If trouble with username in site) -Added by DAMIAN

19. Site Manager (Site Structure) -Added by HUGO CARREIROS

20. Save site as Template (Office365)

Get User Profile Properties From SharePoint Online Using CSOM Console application


Explain you and share Code How to retrieve User profile Properties For SharePoint online site

Step1-Create Console application From VS

Step2-Put SharepointClient.dll and SharepointClient.Runtime.dll in you dll Folder

Step3-Go to your Solution add dll From your bin Folder path

Step4-Copy past below Code

step5-Change in bold text in Code(SiteUrl,Password,User)

Step6-Run Solution , Properties Export in CSV Format

using System;
using System.Security;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.UserProfiles;
using Microsoft.Web.Hosting.Administration;
namespace UserProfileProp
class Program
static void Main(string[] args)
using (ClientContext tenantContext = new ClientContext(“Sharepoint Online SiteURL”))
SecureString passWord = new SecureString();
foreach (char c in “password”.ToCharArray())
tenantContext.Credentials = new SharePointOnlineCredentials(“Username”, “password”,);

PeopleManager peopleManager = new PeopleManager(tenantContext);

UserCollection users = tenantContext.Web.SiteUsers;

string csvFilePath = @”C:\Users\sp_admin\Desktop\users.csv”;
StringBuilder items = new StringBuilder();

//PeopleManager peopleManager = new PeopleManager(tenantContext);
PersonProperties personProperties = peopleManager.GetMyProperties();


tenantContext.Load(personProperties, p => p.AccountName, p => p.UserProfileProperties);
string[] userProfileProperties = new string[personProperties.UserProfileProperties.Count+1];

// string[] userProfileProperties = { “AccountName”, “FirstName”, “LastName”, “PreferredName”, “Manager”, “AboutMe”, “PersonalSpace”, “PictureURL”, “UserName”, “WorkEmail”, “SPS-Birthday” };
int i = 0;
foreach (string key in personProperties.UserProfileProperties.Keys)

userProfileProperties[i] = key;
foreach (string propertyKey in userProfileProperties)

foreach (Microsoft.SharePoint.Client.User user in users)
if (user.PrincipalType != Microsoft.SharePoint.Client.Utilities.PrincipalType.User) continue;

UserProfilePropertiesForUser userProfilePropertiesForUser = new UserProfilePropertiesForUser(tenantContext, user.LoginName, userProfileProperties);
IEnumerable<string> profileProperties = peopleManager.GetUserProfilePropertiesFor(userProfilePropertiesForUser);
foreach (string property in profileProperties)
catch (Exception ex)
throw ex;


System.IO.File.WriteAllText(csvFilePath, items.ToString());



Remarks: when you want to run this console in client machine where share point is not installed To run your Console Followe below step in your solution
– you have to change your dll property Name Copy To Local= True
-Change solution to Release mode and build solutions
-after that copy Release Folder and past in client machine after that run your Exe from that Folder

Hope its Help you


Content Editor WebPart Slider using Adaptor Slider(CSOM)


Description:CEWP Slider using Adaptor Slider

Just Follow the step:

Create Index.html File and Copy past below code into this
you can download Adaptor JS File and Css From this Link

In My case i have Put all File in asset Library bcoz i have used sub site
you can put it in Item Style also but after that Change all reference of file in your html File accordingly

Ok now Goto your sp site and Edit webpart and give reference of your HTML File and Save it
your slider is ready to slide

<!DOCTYPE html>
<script type=”text/javascript” src=”../SiteAssets/Adaptor-Cool-3D/jquery-1.7.2.min.js”></script>
<script type=”text/javascript” src=“../SiteAssets/Adaptor-Cool-3D/box-slider-all.jquery.min.js“></script>
<script type=”text/javascript” src=”../SiteAssets/Adaptor-Cool-3D/modernizr.min.js”></script>
<link href=”../SiteAssets/Adaptor-Cool-3D/screen.css” rel=”stylesheet”>

<script type=”text/javascript” >
ExecuteOrDelayUntilScriptLoaded(loadSlideImages, “sp.js”);
function loadSlideImages()
var clientContext=new SP.ClientContext.get_current();
var oList = clientContext.get_web().get_lists().getByTitle(‘AdaptorImages‘);// Get List
var camlQuery = SP.CamlQuery.createAllItemsQuery();

this.frontPictureItems = oList.getItems(camlQuery);
clientContext.load(frontPictureItems, ‘Include(Id, DisplayName, FileLeafRef,EncodedAbsUrl)’);
Function.createDelegate(this, this.onQuerySucceeded),
Function.createDelegate(this, this.onQueryFailed));

function onQuerySucceeded(sender, args) {
var carousel_html=””;
var listItemInfo = ”;
var listItemEnumerator = frontPictureItems.getEnumerator();
while (listItemEnumerator.moveNext()) {
var oListItem = listItemEnumerator.get_current();
var PicUrl=oListItem.get_item(“EncodedAbsUrl“);
carousel_html += “<figure class=’slide’><img src='”+PicUrl+”‘></img></figure>”;

function applyslider() {

var $box = $(‘#box’)
, $indicators = $(‘.goto-slide’)
, $effects = $(‘.effect’)
, $timeIndicator = $(‘#time-indicator’)
, slideInterval = 5000;

var switchIndicator = function ($c, $n, currIndex, nextIndex) {
$timeIndicator.stop().css(‘width’, 0);

var startTimeIndicator = function () {
$timeIndicator.animate({width: ‘680px’}, slideInterval);
// initialize the plugin with the desired settings
speed: 1000
, autoScroll: true
, timeout: slideInterval
, next: ‘#next’
, prev: ‘#prev’
, pause: ‘#pause’
, effect: ‘scrollHorz3d’
, blindCount: 15
, onbefore: switchIndicator
, onafter: startTimeIndicator


// pagination isn’t built in simply because it’s easy to
// roll your own with the plugin API methods
$(‘#controls’).on(‘click’, ‘.goto-slide’, function (ev) {
$box.boxSlider(‘showSlide’, $(this).data(‘slideindex’));

$(‘#effect-list’).on(‘click’, ‘.effect’, function (ev) {
var $effect = $(this);

$box.boxSlider(‘option’, ‘effect’, $‘fx’));

switchIndicator(null, null, 0, 0);

function onQueryFailed(sender, args) {
alert(‘Request failed. ‘ + args.get_message() + ‘n’ + args.get_stackTrace());
<div id=”viewport” style=”position: relative; perspective: 1000px; overflow: visible; top: auto; left: auto; display: block; width: 680px; height: 460px;”>
     <div id=”box”>



How to Get web/site/List/ Tittle in CQWP.


Explain you here How to Get web/site/List/ Title in CQWP.

Once I got this requirement How to get Web Title or web title where Item is coming and Bind in CQWP

I have done lot`s of R&D For that but there no provision to get web Title or List Title Direct From ItemStyle.xml

It is Possible but How Let `s See

  • Open your .webpart File
  • Find “ViewFieldsOverride” Property
  • In this Property we have to override SharePoint default column like (created, Modified)+your view Column that you use to display in CQWP
  • But Best Practice is just Taking all Field and put it in to this in My Case I have use Task List
  • Now if you want to get Web Title then Define “<ProjectProperty Name=”Title” />”  ,This will return you web/Site Title
  • Same as if you want to get List Title <ListProperty Name=”Title” /> in same manner you can notice in below code
  • Remarks Must Define your FieldRef and Properties inside  <![CDATA[ ]]>  ok now save and upload your web part

<property name=”ViewFieldsOverride” type=”string”><![CDATA[
<FieldRef ID=”{fa564e0f-0c70-4ab9-b863-0177e6ddd247}” Nullable=”True” Type=”Text” />
<FieldRef ID=”{64cd368d-2f95-4bfc-a1f9-8d4324ecb007}” Nullable=”True” Type=”DateTime” />
<FieldRef ID=”{cd21b4c2-6841-4f9e-a23a-738a65f99889}” Nullable=”True” Type=”DateTime” />
<FieldRef ID=”{53101f38-dd2e-458c-b245-0c236cc13d1a}” Nullable=”True” Type=”User” />
<FieldRef ID=”{d2311440-1ed6-46ea-b46d-daa643dc3886}” Nullable=”True” Type=”Number” />
<FieldRef ID=”{7662cd2c-f069-4dba-9e35-082cf976e170}” Nullable=”True” Type=”Note” />
<FieldRef ID=”{c3a92d97-2b77-4a25-9698-3ab54874bc6f}” Nullable=”True” Type=”Lookup” />
<FieldRef ID=”{a8eb573e-9e11-481a-a8c9-1104a54b2fbd}” Nullable=”True” Type=”Choice” />
<FieldRef ID=”{c15b34c3-ce7d-490a-b133-3f4de8801b76}” Nullable=”True” Type=”Choice” />
<FieldRef ID=”{8c06beca-0777-48f7-91c7-6da68bc07b69}” Nullable=”True” Type=”DateTime” />
<FieldRef ID=”{1df5e554-ec7e-46a6-901d-d85a3881cb18}” Nullable=”True” Type=”User” />
<FieldRef ID=”{28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f}” Nullable=”True” Type=”DateTime” />
<FieldRef ID=”{d31655d1-1d5b-4511-95a1-7a09e9b75bf2}” Nullable=”True” Type=”User” />
<FieldRef Name=”PublishingRollupImage” Nullable=”True” Type=”Image” />
<FieldRef Name=”_Level” Nullable=”True” Type=”Number” />
<FieldRef Name=”Comments” Nullable=”True” Type=”Note” />
<ListProperty Name=”Title” /><ProjectProperty Name=”Title” />

-Now open you ItemStyle.xml

you can access Project title  and List Title by

<xsl:value-of select=”ProjectProperty.Title”/>  //Get Web Title

<xsl:value-of select=”ListProperty.Title”/>   // Get List Tittle

Remark Once you modified your webpart ovverride List in  <ProjectProperty Name=”Title” />

in ItemStyle.xslt you will not Get absolute URL [&SiteUrl,$LinkUrl,$PageUrl]

you will get break url in these object so it is tuff to manipulate this URL and get Absolute URL

if you want to get URL For Item you can define <ProjectProperty Name=”Url” /> inside ViewFieldsOverride

now you can access url in Item Style <xsl:value-of select=”ProjectProperty.Url”/>

Hope you Get your issue Resolve from this

Thanks SPS

Copy Document and metadata From one library to Other library using Nintex

Hello Tech People,

I am explaining about Nintex Work Flow which is using in share point to fulfill most of the business requirement.

What is Nintex?

Requirement : 

How can i copy Document and metadata of Document library in share point to other Document library ?

In simple language i have Two Document libraries.

Requirement Of nintex WorkFlow

Requirement Of nintex WorkFlow

I hope you got Requirement carefully.

Solution : 

I m going with the assumption that , Every one has created Two Document library. 1) Source 2) Destination

Click on SourceList -> Click on library in Top Ribbon -> Click on Workflow Setting – >  Create nintex Workflow.


You have to install nintex if you don’t have . Other Wise “Create Workflow in nintex workflow” is not displayed.

And If your system has already nintex . after that you have to active some feature at site collection level which is regarding nintex.


now click on “Create WorkFlow in nintex workflow” nintex Workflow screen will be open .

— > Select Blank WorkFlow and give it Unique Name.After create you can see display which i have define below.


— > Search “Copy to Sharepoint” In Search box . Drag the symbol and put it on Workflow. and name it “Copy Metadata from one Document To Other.” (you can give as per your mood also.)


now click on ARWDOWN in Workflow and Set necessary configuration to fulfill the requirement.


  1. Select Destination :  You have to pass the URl of the Destination Document Library .
  2. over-Write option : 1) Remove existing item 2) Rename new item 3) Update Existing item
  3. Check Create folder Structure
  4. Check Copy In MetaData

Last Step Save the WorkFlow -> Publish it – > Add item to document library – >Check Destination Library 

Note : Nintex Workflow Develop only in IE. 

Have any query , feel free to ask me .

Happy Coding 🙂

Apply Slider in Content Query Web part(CQWP) using XSL

Hello everyone ,

I hope, You are well and doing good.

What is CQWP?

SharePoint Content Query Web Part (CQWP) is a powerful tool to display aggregated content from various SharePoint pages, lists and libraries .

Note : More Information regarding cqwp

Now i am here to explain you how to get List item from SharePoint list and library and display it in Content Query Web part  with attractive manner and  user friendliness.

Now, i have a question .How can i make it attractive manner ? Right . Let me Explain You. I want to tell you that , In attractive manner means put some animation,Give effect with sliding etc etc.

Business Requirement :

I have one share point list name with NewsList. Now i want to display data in “Newslist” on my home page with sliding effect. E.g   I have 5 records in NewsList and I have to display Top 3 records in CQWP . Only one record display in one slide.Slider has to be automatically working . Display field of NewslIst is “Title”, “Date” and “NewsContent” . If  “NewsContent” is more than 40 Characters , than Only 40 characters can be in slider and must be a link Read More… Below that.

I  Hope , Everyone is clear with Requirement. Now i am going to describe solution to fulfill this requirement. There is two way : 1)Add Script Editor to with content query web part and load necessary .js file to share point . 2) Add and load .js file using XSL . I  have prefer second way for get output Solution : Step :1

  •  You have to create one list or library in your share point site.
  • After that you have to select content Query Web part in your page where you want to implement slider

Note: If you are working on TeamSite than you have to activate two features to use CQWP .  1) SharePoint Server publishing infrastructure.(Site level) 2) SharePoint server publishing(Web level) But if you are using Publishing Site than no worry . Two features automatically activated by share point.

  •  Now, You have to configure such setting to get list records in CQWP.

Step : 1

CQWP Steps to open CQWP Tool Part : Edit Page –> Click on Edit Web part –> Tool part is open in left side of your page

Now you have to set path of resource from which you want to take data and show it in to CQWP. Either it is list or Library.

Step : 2

You have to  Export webpart.

Steps to export webpart.

Edit Page -> Edit Webpart ->Click on Export Button ->Web part exported successfully in your local macNow you h


Open Exported .webpart file in share-point designer or in other tool like note or notepad++.

Step : 3

You have to change value of two properties in .webpart. You have to change value of this properties if you are using your custom “itemstyle.xsl” or “contentquerymain.xsl” . if you are using default file than you have not to change it.

1)ItemXslLink   2)MainXslLink

Set your itemstyle.xsl file path in itemslLink and contentquerymain.xsl in Mainxsllink. You can see in image .


Close the.webpart fie and upload webpart in sharepoint.

Edit Page -> Insert -> Click on webpart ->Click on upload webpart -> select webpart -> Click on Upload 

Upload webpart

Step : 4

Now open Itemstyle.xsl To put your login for slider.

I had use Jassor.slider to display data with sliding . You can use any other slider to display data.

Here , Create your custom template to display data in ItemStyle.xsl. i have created SliderTemplate . Here CurPos and LastRaw is two parameter to give some css  or display data in some manner.

This Two parameter is define in contentmain.xsl.







Note :Why is it necessary to create and call “removemarkup”?

If you are direct get data from body field in announcement list than you can get string with some html tag and special character which is not understandable by non-technical person. So we have to remove this type of tag and special character

So i have to remove this type of tags using “removeMarkUp” template. you can use it as per your requirement.


Now  Open your site . open Wenpart Tool panal . and check your custom template is present or not.


If Template is displayed in drop down . That means you have successfully  configures custom template to the web part. You can see slider on page with necessary data.

Kindly contact me if have any query regarding this post.

Happy Coding 🙂

Create Site Column Programmatically in SharePoint


Today I am going to explain you How to create Site column Programmatically (xml)

It should be also created through OOTB and PowerShell

What is site column

Site column is pre define site column which are reused in various content type and List, Libraries

For e.g. you can create a site column “Sample” with a Single Line of text data type . This column then can be added to any content type in your list or library.

We can achieve it two ways

Using Declarative XML

code (Feature Activation Event Receiver)

In this blog we can achieve it through xml..

Ok let`s start

Continue reading

Modules to Include Files In Sharepoint (Basics)


I am going To Explain you Basic Concept of module in share point this is just basic Example How Module is Work actually in sharepoint

Not Confused with Visual Code Module ,Basic use of module Just place File in your Sharepoint Server at specific Locations by Deploying your Solutions

ok Let`s Start the stuff Just Follow Below steps

1.Open Visual Studio and Create New Empty Solution Name (Module Test)

2.Now Open Your Solution Explorer and Right Click on IT

3 Go To add New Item add Module(Name -Module1)

4 Now you can Notice module is Add in your Solution Which Contain two Default File(Element.xml,Sample.txt)

5.Open your Element.xml you can notice Default code Like Below

<Elements xmlns=””&gt;

<Module Name=”Module1″>

<File Path=”Module1\Sample.txt” Url=”Module1/Sample.txt” />



6. Do not change any thing just Deploy solutions and check you sharepoint site Sample.txt File on placed at Module/Sample.txt

File Element has Following Attributes

Attribute Name Description
Path The name and location of the file in the SharePoint solution. The format is,Path=”Module1\Sample.txt”.
Url The location where the file will be deployed on the SharePoint server. The format is,Url=”Module1/Sample.txt”.
Type An optional attribute that has two settings: GhostableInLibrary and Ghostable. The format is,Type=”GhostableInLibrary”. Specifying GhostableInLibrary means the file will be added to a document library in SharePoint together with a list item to accompany the file when it is added to the library. Specifying Ghostable causes the file to be added to SharePoint outside the document library

This is just basic example for your Understanding  I will write more example of Module.Soon




Send Email through REST API in SharePoint

In this article i will explain you how to send E-Mails through REST API in SharePoint.

We can send E-Mails through REST API using SP.Utilities.Utility.SendEmail.

Here is code to send E-Mail using REST API in SharePoint

        contentType: 'application/json',
        url: urlEmail,
        type: "POST",
        data: JSON.stringify({
                  'properties': {
                  '__metadata': { 'type': 'SP.Utilities.EmailProperties' },
                  'Body': 'Hello user.. You got mail from',
                  'To' : { 'results': [''] },
                  'Subject': "E-Mail From REST API";
        headers: {
                    "Accept": "application/json;odata=verbose",
                    "content-type": "application/json;odata=verbose",
                    "X-RequestDigest": $("#__REQUESTDIGEST").val()
        success: function (data) {
                alert("Email Send Successful.");
        error: function (err) {

Here you don’t need to specify from E-Mail Id.

And make sure that To(Send to) E-Mail id should be E-Mail Id of any user from SharePoint Users.

And also make sure that metadata of Email should be


If this method not work or still you are getting error while sending E-Mails then try this method

Using separate function to send E-Mail from REST API

function processSendEmails() {
    var from = '',
        to = '',
        body = 'Dear member you got mail from Code Play and Learn',
        subject = 'Email from REST API';
    // Call sendEmail function
    sendEmail(from, to, body, subject);

function sendEmail(from, to, body, subject) {
    //Get the relative url of the site
    var siteurl = _spPageContextInfo.webServerRelativeUrl;
    var urlTemplate = siteurl + "/_api/SP.Utilities.Utility.SendEmail";
        contentType: 'application/json',
        url: urlTemplate,
        type: "POST",
        data: JSON.stringify({
            'properties': {
                '__metadata': {
                    'type': 'SP.Utilities.EmailProperties'
                'From': from,
                'To': {
                    'results': [to]
                'Body': body,
                'Subject': subject
        headers: {
            "Accept": "application/json;odata=verbose",
            "content-type": "application/json;odata=verbose",
            "X-RequestDigest": jQuery("#__REQUESTDIGEST").val()
        success: function(data) {
            alert('Email Sent Successfully');
        error: function(err) {
            alert('Error in sending Email: ' + JSON.stringify(err));

$(document).ready(function () {
    SP.SOD.executeFunc('sp.js', 'SP.ClientContext', processSendEmails);

Here i have created separate function to send E-Mail in which i am passing information of E-Mails.

By using this methods you can send E-Mails through REST API in SharePoint.

If this blog helps you in understanding SharePoint please share and like this blog.

Happy coding..!!

Learn code while playing with it..!!