Skip to main content
Nintex Community Menu Bar

Regular expression validation in order to create a Document Set

  • June 17, 2015
  • 14 replies
  • 105 views

Forum|alt.badge.img+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

Forum|alt.badge.img+7
  • Author
  • Nintex Partner
  • June 23, 2015

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?


Forum|alt.badge.img+7
  • Author
  • Nintex Partner
  • October 14, 2015

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.


Forum|alt.badge.img+9
  • October 14, 2015

Hi Pierre

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

Kind regards

Manfred


Forum|alt.badge.img+7
  • Author
  • Nintex Partner
  • October 14, 2015

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?


Forum|alt.badge.img+9
  • October 14, 2015

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


Forum|alt.badge.img+7
  • Author
  • Nintex Partner
  • October 14, 2015

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) ?


Forum|alt.badge.img+9
  • October 14, 2015

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


Forum|alt.badge.img+3
  • October 16, 2015

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.


Forum|alt.badge.img+7
  • Author
  • Nintex Partner
  • October 16, 2015

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


Forum|alt.badge.img+9
  • October 19, 2015

Hi Pierre

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

Kind regards

Manfred


Forum|alt.badge.img+7
  • Author
  • Nintex Partner
  • November 24, 2015

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.


Forum|alt.badge.img
  • June 1, 2017

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


Forum|alt.badge.img+7
  • Author
  • Nintex Partner
  • June 2, 2017

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


Forum|alt.badge.img+7
  • Author
  • Nintex Partner
  • June 2, 2017

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