cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

A couple easy questions for a Nintex Pro...

Jump to solution

I have a list with a Nintex form.  I would like to do these with Nintex form rules rather than Column / List validation if possible.

First off, I need to disallow forbidden characters from the item title field, with a message that says something like "Your title has forbidden characters...." if someone tries to enter them. 

(I'm using this field to create an excel filename with a workflow later on.  Using a regex to scrub the user entry, replace forbidden characters with "-" and update the title with the scrubbed value is working, except when the scrubbed value is a duplicate to one that already exists in the list)

I've been trying to use something like this:

=AND(IF(ISERROR(FIND(",", [ColumnName])),TRUE),IF(ISERROR(FIND("&", [ColumnName])),TRUE),IF(ISERROR(FIND("!", [ColumnName])),TRUE),IF(ISERROR(FIND("@", [ColumnName])),TRUE),IF(ISERROR(FIND("~", [ColumnName])),TRUE),IF(ISERROR(FIND("#", [ColumnName])),TRUE),IF(ISERROR(FIND("$", [ColumnName])),TRUE),IF(ISERROR(FIND("%", [ColumnName])),TRUE),IF(ISERROR(FIND("*", [ColumnName])),TRUE),IF(ISERROR(FIND("(", [ColumnName])),TRUE),IF(ISERROR(FIND(")", [ColumnName])),TRUE),IF(ISERROR(FIND("-", [ColumnName])),TRUE),IF(ISERROR(FIND("+", [ColumnName])),TRUE),IF(ISERROR(FIND(":", [ColumnName])),TRUE),IF(ISERROR(FIND(";", [ColumnName])),TRUE),IF(ISERROR(FIND("[", [ColumnName])),TRUE),IF(ISERROR(FIND("]", [ColumnName])),TRUE),IF(ISERROR(FIND(".", [ColumnName])),TRUE),IF(ISERROR(FIND("/", [ColumnName])),TRUE),IF(ISERROR(FIND("\", [ColumnName])),TRUE))


But it's not playing nice with question marks and nesting IFs.


Also, I have a choice column (A) (radio button) that has three options.  I would like one of the options to be invisible unless a different choice column (B) (drop down) has a particular option selected.  I know this is possible, but I'm not sure how.

Thanks for any assistance!

Labels: (2)
0 Kudos
Reply
7 Replies
Workflow Hero

Re: A couple easy questions for a Nintex Pro...

Jump to solution

but your formula is from list (field) validation, right?

this will not work as nintex form validation.

I think regex is the best option for your validation. it certainly can spot your forbidden characters, even if they appear several times within the input.

see following formula

your validation then might look like

Reply
Workflow Hero

Re: A couple easy questions for a Nintex Pro...

Jump to solution

Marian,

Thanks for the reply.  My field is a Single Line Textbox and I'm not sure how to get the "Formula" dialog that you have there (you're using a calculated value and the Control Settings are different).

0 Kudos
Reply
Workflow Hero

Re: A couple easy questions for a Nintex Pro...

Jump to solution

Never mind I think I've seen what you did there....let me try.

0 Kudos
Reply
Workflow Hero

Re: A couple easy questions for a Nintex Pro...

Jump to solution

I'm not having a lot of luck getting this to work, but also, my main goal was to disallow forbidden characters, not replace them.  I want to drive the behavior in my users that they shouldn't use forbidden characters in the item titles.

0 Kudos
Reply
Workflow Hero

Re: A couple easy questions for a Nintex Pro...

Jump to solution

my main goal was to disallow forbidden characters, not replace them

that's exactly what my above example is about.

first two screenshots are a reply to your statement that you didn't succeed with regular expressions. they just shows that with regular expression you can determine any of your forbidden characters, and regardless of how many time they appear in input string.

rest of the screenshot visualize the validation rule formula you need.

the formula works so that if there appear any of forbidden characters in input string, it's replaced with a dash. replace result is compared to original input string. if they do not match there definitely had to be a forbidden character. if they match, nothing was replaced, so no forbidden character in input.

aren't examples of different inputs I provided clear enough?

just copy&paste it and it should work

0 Kudos
Reply
Workflow Hero

Re: A couple easy questions for a Nintex Pro...

Jump to solution

First off, I need to disallow forbidden characters from the item title field, with a message that says something like "Your title has forbidden characters...." if someone tries to enter them. 

Alright. This is easily doable. If you want to just replace all of the characters that are invalid with valid ones, that's also doable, but it would remove any reason to show a warning, and doesn't encourage your users to get it right... So...

Let's inform the user that they have made a mistake (and force them to change their filename for us)!

Here's a typical Single Line Text control that has been linked to the Title column.

To make our message, we need to create a Validation Rule

The rule setup will look like this: 

Here is the code, explicitly (you can just copy / paste that right in): 

{Control:Self}.match(/[^A-Za-z0-9\-\_\ ]/gi) !== null

The Regex (/[^A-Za-z0-9\-\_\ ]/g) is trying to match any character that ISN'T A through Z (uppercase), a through z (lowercase), 0 through 9, a dash -, an underscore _, or a space. An attempt to use any other character will result in an error being thrown. 

If there are characters that are allowed which have been missed by the above regex, you can add them at your discretion (or remove them if I have included an invalid character, like, space). 

As for your other topic about the hiding of select options, I would create a different forum topic to discuss that, so that we don't muddy the waters on this one. 

Does this help get you going in the right direction? 

Reply
Workflow Hero

Re: A couple easy questions for a Nintex Pro...

Jump to solution

Worked like a charm, thanks for making it easy!

0 Kudos
Reply