No ratings

Dictionary Variables and Related Actions Upgrade

Scenario

 

This How To article provides information for upgrading a Nintex for Office 365 workflow to Nintex Workflow Cloud that uses SharePoint Dictionary variables with actions like Build dictionary, Count items in a dictionary, and Get an item from a dictionary. Nintex Workflow Cloud does not support dictionary variables or related actions. Many business cases use Dictionaries to work with complex data in JSON or XML formats that come from web service calls. Nintex Workflow Cloud provides newer ways to work with this data.

 

After Upgrade

 

  • Your start event Connection property will need to be updated with an existing connection to SharePoint in your NWC environment.

  • Dictionary variables will be marked with a resolve warning message. You will need to either replace them with another variable type or delete them.

  • Build Dictionary, Count items in Dictionary, and Get an Item from a Dictionary actions will be replaced with placeholder actions that need to be deleted as they are not supported. 

  • Other actions that use a dictionary variable will be marked with a yellow warning icon that states dictionary variables are not supported.

 

Workflow After Upgrade.png

 

Differences

 

  • For SharePoint web service requests, use the action named, Call a SharePoint web service. This data will be stored in an object variable instead of a dictionary and can be parsed using the Query JSON or Query XML actions with JSONPath or XPath expressions respectively, to access data values.

  • In Nintex for Office 365 the Call HTTP Web Service action uses dictionary variables for Request Headers and Content as well as Response Content and Headers. This action will become Call a web service and dictionary variables will not be available to its properties.

  • If you previously used a dictionary variable to store request or response headers for web requests early in your workflow design, you will need to switch to either a text variable or enter request header text directly in the web request actions.

  • For external web requests, response data that comes back using the Call a web service action can be stored in a text variable. To access data values stored in your variable, use the Query JSON or Query XML actions with JSONPath or XPath expressions respectively.

 

Configuration

 

SharePoint web services

Use the action named, Call a SharePoint web service, to query SharePoint lists, libraries, and sites when you want to query a SharePoint REST api endpoint. Rather than a dictionary variable, this action will store results in an object variable. See the steps below that correspond to the numbered image.

 

Steps for Call a SharePoint web service.png

 

  1. Configure the connection property specific to SharePoint connections in your environment.

  2. Enter the endpoint's URL to the SharePoint list, library, or site you are querying. Variables can be included here to complete the path dynamically if necessary.

  3. Enter your request headers as needed. In this example, we're pulling back JSON formatted data as specified by the headers. Variables can be used here to complete the request headers dynamically.

  4. Create an object variable to store the response output from the web service. This will be  JSON response data in the example above. This object can be queried later in the workflow for data values.

    QueryJSON for SharePoint service.png


  5. Use a Query JSON or Query XML action to query the response data that can be found in the Response content value from the object variable created in step 4 for the Call a SharePoint web service.

  6. Insert the JSONPath or XPath expression you would like to use to extract data values from the content.

  7. Store the data value in variable based on the first result if desired. You can also store all results of the query in a collection variable.

 

 

External web services and dictionary variables

The action, Call HTTP Web Service, will be converted to the Call a web service action after the upgrade. If you used dictionary variables in the Nintex for Office 365 workflow, you will need to change these variables to text variables or delete them and enter the text values directly in the action. Let's look at those steps as they line up with the images below.

 

 

Review Dictionary Variables.png

  1. Open the variables area and review what dictionary variable references came over. 
  2. Determine which variables need new text variables as replacements or delete them if they are not needed. 

    Resolve dictionary variables.gif

  3. Resolve the dictionary variables with newly created variables. This will update any actions that are currently referencing a dictionary variable with the new variable automatically.


    Delete Unsupported Actions.gif
  4. Delete unsupported dictionary actions.


    QueryJSON for Web Service Call.png

  5. Use a Query JSON or Query XML action to query the response data that can be found in the Response content variable.
  6. Insert the JSONPath or XPath expression you would like to use to extract data values from the content. The example above uses a JSONPath expression to get book titles for an author.
  7. Store the first result from a list of items in a variable as needed. You can also store a list of all results in a collection variable.

    Looping on Collection.png

  8. You can use the collection variable actions for accessing values if required. By working with a collection here, you can replace the dictionary actions like Get an item from a dictionary or Count items in a dictionary with similar collection actions.

 

 

References

Version history
Last update:
‎11-16-2021 02:29 PM
Updated by:
Contributors