Upgrade actions that use Dictionary Variables

  • 12 December 2022
  • 0 replies
  • 182 views

Userlevel 3
Badge +11

Scenario

 

How to upgrade 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.

  • Some actions that use dictionary variables may be upgraded by automatically replacing the dictionary variable with a Nintex Workflow Cloud object variable. For more details on how to work with object variables, you can review the article, Working with object variables after upgrade.
  • 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. 

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

 

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.

 

 

  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.
     



     

  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.

 

 

  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. 
     

     
  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.

     

     

  4. Delete unsupported dictionary actions.

     

     
  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.
     

     
  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.

 

Office 365 Query List and Dictionary variables

The example here shows the Office 365 Query list action storing results in dictionaries, then processing it with For EachQuery XML, and Get an item from a dictionary actions.

 

Actions that use the dictionary will be marked as unconfigured and will need to be updated with actions that process data using the new object variable, or deleted.

 

 The object variable may improve your workflow design because it requires less steps to access information in many cases. For the workflow example in the image below, the placeholder action titled, Get an item from a dictionary, was removed. It also doesn't require querying XML for data and works directly with the result object variable in a Loop For each action.

 

 

References


0 replies

Be the first to reply!

Reply