Skip to main content
Nintex Community Menu Bar

I have a form with a choice field (drop down list).  I am including the user’s selection in an email after they click submit.  However that field shows up with preceding and ending characters that I do not want in the body of the email.  (example below).  How do I remove those characters?  I have looked at converting the string, modifying the value using trim but am at a bit of a loss.

Output example.

Sean OBryant  from district e"District 7"]has submitted the following question directed to Cultural Arts  

I figured it out with a little help from ChatGPT.

I used the Apply a regular expression action to capture the text then replace it with just the text I wanted.

 

 


Hi ​@seanobryant65,

 

Thank you for sharing.
There are several easier methods to resolve this issue.

  1. If you only need one choice, then use a Choice Single control on the form. The output will be in plain text with no special characters. This can be inserted directly into an email. The reason the Choice Multiple control returns special characters is because the output is a collection (array) that can store multiple choices. It does this even if there is only one choice chosen.
  2. If you need a Choice Multiple control, you can use a Get items from collection action to extract the choice(s) in plain text.
  3. If there will be multiple choices selected, then using a Loop for each action to extract each choice (in plain text) for each index which simplifies the extraction.

Your solution is sufficient, but for non-developers, regular expressions can be difficult.

 


Reply