Wednesday, June 26, 2013

Get Day of week in Sharepoint 2010 designer workflow

Get Day of week in SharePoint 2010 designer workflow


Hi everyone, 

In this article I'm going to show you how to get the day of a week as in Monday, Tuesday, etc.. in SharePoint workflow using SharePoint designer.
 

In SharePoint workflow there is NO inbuilt function or command to get the day according to the research i did. So what I did was get the date as a long date (ex : Friday, June 21, 2013 ) and got the day as a string  using sub-string function. 

Step 1 : Get the sub-string









Choose the last on because you will want to give the length.

Step 2 : Select the date where you want to get the day of the week in this case it's created date.

 select as mentioned above.

Step 3 : Set the starting index and the length of the word.
 
  •  please note that the starting index is "1" in this index not "0"
I wanted to check the date is a "Friday" so as in the above table I put 
"starting at 1 for 6 characters" and the Output comes to the "Variable:substring". (You can define a new variable to get the output)


Then use it anywhere you want.




References :

Note :
I tried to give the length of the string dynamically by getting the index number of the first comma (Friday, June 21, 2013) using IndexOf(string) method mentioned in the above reference url. But it doesn't work as I wanted it to so i gave the length statically.

If you find a away to get the length of a string dynamically or an easy way to find the day, please leave a comment. :)

6 comments:

  1. Thank you! This was quite helpful

    ReplyDelete
  2. Hi Nishon

    It helped me a lot. Many Thanks for the Post....

    ReplyDelete

  3. So happy to be given a privilege to post a comment here. You have a wonderful site. Thank you for the effort to publish this.

    Bry
    www.gofastek.com

    ReplyDelete
  4. This is another solution

    http://www.documentmanagementworkflowinfo.com/sample-sharepoint-workflows/sharepoint-designer-workflow-check-today-saturday-sunday.htm

    ReplyDelete