Dictionary actions example in SharePoint Designer 2013

This SharePoint designer workflow tutorial, we will discuss how to use dictionary workflow action in SharePoint 2013 designer workflow. Here, we will see how to build dictionary, loop through dictionary and get item from dictionary in SharePoint designer 2013 workflow.

SharePoint designer 2013 workflow dictionary

Dictionary variable type is new in SharePoint 2013 designer workflow. Dictionary variable can store different types of variables.

Suppose you want to store Employee Name (String type), Age (Integer type) & Date of Joining (Date type) then in SharePoint 2010 we have to create 3 variables of string, int & date type which can hold the employee data.

But in SharePoint 2013 we can build a Dictionary type variable which can store different type of employee data.

A SharePoint designer 2013 dictionary variable can support the following types:

  • Boolean
  • Date/Time
  • Dictionary
  • Guid
  • Integer
  • Number
  • String.

In SharePoint 2013 designer workflow, Dictionary variable type has three different actions:

  • Build Dictionary
  • Count Items in a Dictionary
  • Get an Item from a Dictionary

These workflow actions will be available under the Core Actions type.

First, insert a Build Dictionary action in the workflow. When you insert this action it will appear like below:

sharepoint 2013 workflow build dictionary

Click on this link to build the dictionary.

Once you click on this it will open a dialog box to build Dictionary. Then click on Add… to Add a Dictionary item. Once the dialog box will open it will ask you to give a name & Type and Value like below:

build dictionary in sharepoint designer 2013

Once the build Dictionary is ready, you can then add “Count Items in a Dictionary” action to know how many items there in the Dictionary variable. Once you will add, it will appear like below:

sharepoint 2013 workflow dictionary

You can click on the dictionary like to choose your dictionary variable name. The value will be stored in the Variable count.

Now, at last, we will use “Get an Item from a Dictionary” action to get value from the Dictionary variable. When you put this action, it will appear like below:

sharepoint designer 2013 workflow dictionary

Click on an item by name or path to put the variable name or you can directly write variable name also like Name, Age or Salary. These are the variable names which we have created while building the dictionary.

And click on the Dictionary link to choose your Dictionary variable. It should look like below:

sharepoint 2013 workflow loop through dictionary

Here I have then just logged this information to the Workflow history list.

Your workflow looks like below:

sharepoint 2013 workflow get item from dictionary

You may like the following SharePoint workflow tutorials:

This SharePoint tutorial, we learned how to use a dictionary variable in SharePoint 2013 designer workflow.