1 comment on “Nintex Forms for Nintex Workflow Cloud – Saving Multi-choice fields to SharePoint Lists”

Nintex Forms for Nintex Workflow Cloud – Saving Multi-choice fields to SharePoint Lists

Nintex Forms for NWC was just released yesterday, and just in time for me to add a contact form to my new website (https://www.docfluix.com).  Matt Jennings already posted an awesome intro for Nintex Forms for NWC so check this out to understand what this awesome new product is all about.

Background Info

My goal for my first Nintex Forms for NWC project was to create a simple web contact form (Name, Company, Phone, Email) and save the data to a SharePoint list. I also decided to add a multi-choice control named CustomerInterest to my form with the following options:

  • Workflow / Business Process Automation
  • Document Management (ECM / Records Management)
  • Collaboration
  • Intranet / Portals
  • Migration to SharePoint
  • SharePoint Governance
  • SharePoint Adoption

In my SharePoint site, I added an out of the box Contacts list, and customized it with a choice field (also named “CustomerInterest”) that allows multiple choices and includes the identical options above.

After the Start Event, I added the SharePoint Online action Create an Item to my workflow and connected it to my site.

This action displays the columns from my new SharePoint contact list including the CustomerInterest field.  Initially, my plan was to directly map the CustomerInterest collection variable to the CustomInterest SharePoint column. However, that approach does not work.  The solution however, is quite easy but not totally obvious…

To understand the solution, please note the following:

  • When you define a Multiple Choice field in Nintex Forms for NWC, it creates a variable for that control of type collection.  This collection shall be populated with only the choices that the user selected.
  • If you want to populate a multi-choice column in SharePoint, you need to pass it a concatenated string of all values separated with ;# (semi-colon hashtag).  So I would need to export a string that looks like this: “Collaboration;#SharePoint Governance;#SharePoint Adoption
  • In Nintex Forms for NWC, the title that is displayed for each control becomes the name of the start event variable created in the workflow.  So in my form, the multi choice field is titled as “Are you looking for assistance with:“, and so that is also the name of the collection variable that I will reference in my workflow.

Solution

The solution is to iterate through the collection variable and format a text variable the way SharePoint expects for a Multi choice column.  Although this part is quite simple, I’ll outline my steps:

  1. Define new variables:
    • CustomerInterests (Text) – Will store the concatenated value to map to the SharePoint choice column
    • ChoiceItem (Text) – Will store each selected choice from the collection variable
    • Idx (Integer) – Used for loop processing
  2. Add a Loop For Each action configured as follows:
    • Target Collection: Are you looking for assistance with:
    • Store Item: ChoiceItem
    • Index: Idx
  3. Within the Loop For Each action I added
    • Get Item from Collection action
      • Target Collection: Are you looking for assistance with:
      • Index: Idx
      • Store Item: ChoiceItem
    • Set a variable value action (optionally, the Create a text string action would also work the same way)
      • Variable: CustomerInterests
      • Value: [CustomerInterests][ChoiceItem];# (this concatenates the next ChoiceItem to the end of the string for each iteration)
  4. In the Create an Item action, now I was able to simply assign the CustomerInterests text variable to the CustomerInterest SharePoint column.  When this action executes we end up with a new list item in SharePoint with the intended choices selected.

Here is what the completed form looks like:DocFluix Contact Form

0 comments on “Using Nintex Workflow Cloud? Always Start with External Start!”

Using Nintex Workflow Cloud? Always Start with External Start!

When I first started using using Nintex Workflow Cloud back in the early preview days, the first workflows that I created used various Start Events from both Nintex (Public Web Form, Nintex Mobile, Scheduled Start, External Start) and some external connectors (like Salesforce & Dynamics CRM).

As I jumped into NWC and started creating some workflows, I would pick a particular start event (say Public Web Form) and implement my workflow logic. Then I might decide that I want to test the same workflow logic but using a different start event, perhaps Nintex Mobile or Salesforce.  However, one cannot simply change Start Events if there are any references in the workflow to the Start Event variables.  These need to be removed before you can change the type of Start Event.

After developing a few processes with Nintex Workflow Cloud, I realized the best bet is to always put your core workflow logic in a workflow using the External Start Event.

Then you can create one or more additional workflows that leverage other Start Event types, which can easily call your core workflow via External Start.  This is accomplished using the Call a Workflow action.  Here are the steps:

  1. Create your core workflow using the External Start and add whatever start event variables that your workflow needs.  Then implement the workflow logic and publish your workflow.
  2. Create a 2nd workflow, using whichever start event you expect the end users will need, such as Public Web Form, Nintex Mobile, Salesforce, etc.  This workflow will need the identical start event variables as the first workflow. However, this workflow will only require one action.
  3. After the Start Event, simply drag the Call a Workflow action (from the Logic and Flow group) under the Start Event.
  4. In the configuration for the Call a Workflow action, the first setting is to select which workflow you wish to start.  It will display a list of all published workflows that use an External Start Event:

  1. After selecting the desired workflow, the configuration screen will display fields for each Start Event variable from the selected workflow.  You can simply map the Start Event variables from the current workflow to the inputs of the workflow that you will call via External Start.


After mapping the Start Event variables, you can simply publish your 2nd workflow.  If you know you need additional ways to call your core workflow logic, you can immediately repeat steps 2 – 5 above using other Start Event types.

By using the External Start event you’ll also be able to initiate your NWC workflow just as easily from Nintex for SharePoint 2013/2016 or SharePoint Online, using the “Start workflow in Nintex Workflow Cloud” action.  Additionally, custom apps and other cloud services will be able to initiate your workflow using the OpenAPI (swagger) protocol.

Even if you don’t need to initiate your core workflow logic in multiple ways, NWC makes it so easy to use this pattern that its almost always a good idea to start with the External Start event.  You just never know when your business requirements might change in the future; And this way you (and your NWC workflows) will always be prepared for new requirements.

 

0 comments on “Welcome to Insights on Workflow and ECM…”

Welcome to Insights on Workflow and ECM…

So, this is my first Blog post in over 2 years, when I sold my share in Hershey Technologies to Konica Minolta.  I never had a personal Blog before as I had simply used the HersheyTech website for my personal blogging.  Since our acquisition by KM, I simply hadn’t gotten around to launching my own Blog.

As a software consultant/architect with SharePoint and Office 365, I’ve worked on many projects covering many aspects of these products (collaboration, upgrades, migrations, intranets/portals, ECM, workflow, custom development, etc.).

This Blog will cover all of these topics and more.  But as the site name says, my focus here will be mainly related to Workflow (especially Nintex and Microsoft Flow) and Enterprise Content Management (with a focus on leveraging native ECM-related features in SharePoint and Office 365).