You are viewing limited content. For full access, please sign in.

Question

Question

Field Constraint not allowing a Line Feed or Carriage Return

asked on June 30, 2014

We have a Comments field that users are able to capture certain comments. the width of the field is 500. I would like to put a constraint on the field that will only allow normal text, no line feeds or bullet points.

 

Every now and again a user will copy text from a email into this field, and it then contains the above mentioned, and this is causing a problem when updating these comments to a 3rd party db.

 

Any suggestions on what the syntax of the constraint would be?

 

0 0

Answer

SELECTED ANSWER
replied on June 30, 2014 Show version history

The field constraint [^\n^•]* will reject any value that contains newlines or bullet points. Make sure to set the constraint validation message so that users get a helpful error explaining that they need to remove the offending characters.

1 0
replied on June 30, 2014

Thanks. This solved my problem.

0 0

Replies

replied on June 30, 2014

Have you considered having no field constraints from a user perspective but a workflow to remove those 'editing characters' prior to update your 3rd party db?

0 0
replied on June 30, 2014

Thank you for the idea. we have not considered that. So just to confirm your approach, it would be to use a regular expression in WF applied to the field data doing the update to the DB?

 

Constraint provided by Robert did solve the problem from a client perspective but your suggestion could help in other areas. thanks.

0 0
replied on July 1, 2014

So taking the suggestion of Louis-Simon into account how do I do the following:

Lets assume I receive the following text that is typed into a field:

"This is a simple message:

  • to indicate? the format
  • in which, the field might;
  • %be typed & indicating
  • * any

 

characters used by the user!"

 

How would I go about in Workflow to extract only the text  and not any special characters or bullet points, and then pass that onto my 3rde party app or DB?

 

I've bee trying to get this to work using regular expressions on the Token but not getting to the correct one that will return all text and leave out the rest.

 

0 0
replied on July 2, 2014 Show version history

Vince, try this one:

 

 

PS: sorry for the delay as yesterday was Canada Day !

0 0
replied on July 2, 2014

Thanks for the info and the screenshot.

 

In the interim I manged to use the following which seemed to also work:

excuse the test text, tried variations to see how it handles it, but this seems to provide us with the result we need, or rather can use.

 

hope you enjoyed Canada day..

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.