SharePoint Designer 2013: Build Dictionary Action

Sign up for an Office 365 Developer Site

Be sure you have access to an Office 365 Developer Site. Here are three ways to get one:

  • Are you an MSDN subscriber? Visual Studio Ultimate and Visual Studio Premium with MSDN subscribers receive an Office 365 Developer Subscription as a benefit. Redeem your benefit today.
  • Do you have one of the following Office 365 subscription plans?

      Office 365 Midsize Business
      Office 365 Enterprise E1, E3, E4, or K1
      Office 365 Education A2, A3, or A4
      Office 365 Government G1, G3, G4, or K1

    If so, you can provision a Developer Site from the Office 365 admin center. For more information, see How to: Create a Developer Site within your existing Office 365 subscription.

  • You can either start with a free 30-day trial, or buy an Office 365 developer subscription (with one user license for either option) using one of the following links. This subscription costs $99.00 per year.

Please refer to Sign up for an Office 365 Developer Subscription and set up your tools and environment for more details.

Install SharePoint Designer 2013

SharePoint Designer 2013 is a free download. To download and install SharePoint Designer 2013 use the following procedure.

To install SharePoint Designer 2013

  1. Open your web browser and navigate to the Microsoft Download Center.

  2. Click on the Download button.

    Download

  3. Select your platform type: 64-bit (x64) or 32-bit (x86). Click on the Next button.

    Select your platform

  4. Follow the instructions to install SharePoint Designer 2013.

    install SharePoint Designer

Dictionary Variable

SharePoint Designer 2013 has a new variable type called Dictionary. The Dictionary variable type is a container designed to hold a collection of other variables.

The following list defines the variable types available:

  • Boolean: A Yes or No value.
  • Date/Time: A date and time.
  • Dictionary: A collection of variables.
  • Guid: A Globally Unique Identifier (GUID).
  • Integer: A whole number without decimals.
  • Number: A number that can contain decimals.
  • String: A string of characters.

For example, your workflow might need to store more than just the name of the employee. It might also need to store his address and birth date. If you do not use the Dictionary variable you will need to create multiple stand-alone variables. This can quickly become difficult to organize and difficult to work with in the logic of the workflow. A Dictionary variable allows you to store multiple data points in a single variable.

I have created a simple custom list that has the following fields. In this article we will see how to use a Build Dictionary action and display the values in one of the fields (we will display it in the “Notes” field).

custom list

Workflow Design

Workflow Design

The following is the output. 

output

Note: The dictionary variable value is stored in the notes field.

Connect to a SharePoint Online site in SharePoint Designer 2013

  1. Open SharePoint Designer 2013.

  2. Click on Open Site.

    Open Site

  3. Enter the site URL and then click on the Open button.

    SharePoint Designer 2013

  4. Enter your credentials, if prompted. Be sure to use credentials that have access to the SharePoint 2013 site.

  5. The site is opened successfully in the SharePoint Designer 2013.

Create a list workflow and add Build Dictionary action

  1. Click on the Workflows link in the Navigation Pane.

    Navigation
  2. Click on the List Workflow button in the interface and then click on the list to which the workflow should be added.

    Click on List Workflow

  3. Enter the Name and Description for the workflow.

    Description

  4. Select SharePoint 2013 as a platform type.

  5. Click on the Ok button.

  6. Click on the Action button in the ribbon interface and then click on the Build Dictionary action as in the following.

    Action

  7. Click on the “this” link, a Build a Dictionary dialog box is opened.

    Build a Dictionary

  8. Click on the Add button.

  9. Add the dictionary items as in the following.

    dictionary items

    Add the dictionary

  10. Click on the Ok button.

  11. Add an “Update List Item” action as in the following.

    Update List Item

  12. Click on the “this list” link. An Update List Item dialog box is opened.

    this list

  13. Click on the Add button and assign the value to the field.

    Click on Add button and assign the value

  14. Click on the Ok button.

  15. Click on Transition to stage and then click on the Action button in the ribbon interface.

  16. Click on Go to a stage.

    Go to a stage

  17. Select End of Workflow.

    End of Workflow

  18. Click on the Publish button in the interface.

    Publish button

  19. The Workflow will be saved and published to the SharePoint 2013 list.

    published

Test the Workflow

  1. Navigate to the Office 365 developer site.

  2. Navigate to the SharePoint list to which the workflow is added.

  3. Click on the List tab and then click on Workflow Settings.

    Workflow Settings

  4. You will see the workflow has been added to the list successfully.

  5. Navigate to the list and select an item.

  6. Click on Workflows in the ribbon interface.

    Workflows

  7. Click on List Workflow.

    List Workflow

  8. After a few minutes the workflow is completed successfully and the “Notes” field is updated with the dictionary value as in the following.

    Notes

Summary

Thus in this article you saw how to use a Build Dictionary action in SharePoint Designer 2013.

Up Next
    Ebook Download
    View all
    Learn
    View all