Protiviti / SharePoint Blog

SharePoint Blog

May 20
Nintex 365: Properly Display Choice Field in Email

​Problem:

You have a Choice field set up as follows:
 


You want to display this in an email and you choose the field.  Unfortunately, it looks like the following when the email is sent:

 

The question is how to show just the choices comma delimited.   On top of this we are going to display the choices WITHOUT a loop.  Also, we will creatively utilize the regular expression action.


Resolution

1. Assign the current record ID to a workflow variable.  In my case, I used varID.

2. Configure Query List Action

The Query List pulls all the records in the table but I just wanted the record for the current row.  Using the varID from step one I retrieved this.

 
 
    

The second part of the query list configuration is selecting only the column you would like and assigning it to a collection variable.


 
 
 

Here is what the collection variable looks like:

 
 
3. Create another workflow variable that is of type TEXT and assign set it to the collection.
 
4. Utilize the Regular Expression action and configure as such:
 
 

What we are doing is a replace on the quotes and putting the result into another variable of TEXT type called varStatesReplaced.  Notice that we can leave replacement string blank – fantastic!

We create two more regular expression actions, one for beginning brackets [[[] and one for the ending brackets []]].

5. We add one last Regular expression and it configure it as follows:


In this case we output the Split to a new collection variable.  This is so we can get our count.

6. Add the Count Items in Collection and configure it to count the collection from Step 5.


7. Create a send email item and utilize the fields that you manipulated in the regular expressions. The resulting output will be as follows:


No loops and this was done in 9 steps.

Quick Launch


© Protiviti 2019. All rights reserved.   |   Privacy Policy