Skip to main content
Nintex Community Menu Bar
Solved

How do I trim the results of a Choice field

  • January 2, 2025
  • 2 replies
  • 24 views
  • Translate

seanobryant65
Forum|alt.badge.img+4

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 ["District 7"]has submitted the following question directed to Cultural Arts  

Best answer by seanobryant65

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.

 

 

View original
Did this topic help you find an answer to your question?

2 replies

seanobryant65
Forum|alt.badge.img+4
  • Author
  • Rookie
  • 14 replies
  • Answer
  • January 2, 2025

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.

 

 

Translate

SimonMuntz
Nintex Employee
Forum|alt.badge.img+22
  • Nintex Employee
  • 2461 replies
  • January 3, 2025

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.

 

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings