Regular expression validation in order to create a Document Set


Badge +7

Hi,

 

I'd like to use a Nintex Form on a custom list in which one of its fields will be used to create a Document Set via Workflow.

To avoid illegal characters, I wanna set a regular expression validation on my field with this RegEx :

 

^[^~"#%:<>?/{|}. ]{1}[^~"#%:<>?/{|}]{0,121}[^~"#%*:<>?/{|}. ]{1}$

 

I tested it with couple of online services and it seems to be OK.

 

But in my form, I've got strange behaviours... Some lowercases are invalid (example : "To try" is invalid while "TO TRY" is OK...).

 

Am I wrong on something?

Is there another way to avoid those characters : ~ " # % & CONT_IDS_CLEAN CORRECT_ANSWERS DISC_IDS_CLEAN content_ids curl_test.sh disc_ids_qready discussions queries questions_set.log test test_CID test_body : < > ? / { | }

 

Thanks.

Regards,


14 replies

Badge +7

In order not to block my customer, I used a workaround via Custom validation function, as mentionned here :

JavaScript To Validate Single Line Field Based On List Lookup Control Value - Nintex Form 2013

 

With this function :

 

function InvalidPathChars(source, arguments)

{

  var patt = /^[^~""#%*:<>?/{|}.'>\]{1}[^~""#%:<>?/{|}\]{0,121}[^~""#%*:<>?/{|}. \]{1}$/ig;

  arguments.IsValid= patt.test(arguments.Value);

}

 

Now, why does it work via JavaScript, not via the regular expression validation?

Badge +7

Manfred Lauer​ suggests me to escape '/' in the regular expression.

But even if I escape those chars, like this :

^[^~"#%:<>?/{|}. ]{1}[^~"#%:<>?/{|}]{0,121}[^~"#%*:<>?/{|}. ]{1}$

Regular expression validator triggers weird results:

For example, the word "Test" (without quotes) is considered invalid while "Foo" is OK.

Badge +9

Hi Pierre

it looks like / has no special meaning in .NET regular expressions. Therefore I deleted my comment.

Kind regards

Manfred

Badge +7

Hi Manfred,

No matter.

But are we OK about the stange behavior I have when "Test" is not considered as valid with that expression?

Am I the only one who has a such result with that regular expression?

Badge +9

Hi Pierre

what is your Nintex Forms version? I tested with Nintex Forms 2013 Version: 2.6.0.0 and it looks OK:

Kind regards

Manfred

Badge +7

Nintex Forms 2013 Version 2.5.0.0

But your sample is OK in my version too.

Could you please test it with the specific word "Test" (which has no special character but fails in my case) ?

Badge +9

That's strange, the pattern doesn't match the word  "Test" in my Form but should do it!

Badge +3

I'm running into similar strangeness trying to exclude special characters from a field with the expression [^&<>:"/\.|?*]  The validation always fails, regardless of what's in the field.

Badge +7

Does anyone know how we could alert Product Team on a such issue ?

Badge +9

Hi Pierre

Open a ticket (Support --> Nintex Support: Create Ticket).

Kind regards

Manfred

Badge +7

Hi everyone,

I just received a notification from the Nintex support to confirm that the Dev Team considers it as a bug.

This would be fixed in a next release.

Badge

Hi Pierre,

I'm actually trying to setup something exactly like this! how did you setup your workflow to create a docset when a submission is made?

Thanks,

Terek

Badge +7

I didn't come back on this topic but Support fixed the bug in 2.9.3.0 Nintex Forms release happy.png

Badge +7

Hi Terek,

I'm not really sure about what you're looking for.

In my scenario, there's a list item which collect data. In its form, I've added the custom validation function in order to obtain the expected label, used to create the document set in a second time.

Saving the item starts a workflow which uses the "Create item" action on a specific "Document set" content type with the previous label.

Is it what you're looking for? happy.png

Regards

Reply