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

Question

Question

Character limit fail?

asked on June 26, 2017

I limited a field in our form to 100 characters.  The form submitted looks like it's holding the 100 characters perfectly but the form kicks off a workflow and the workflow has the full string at 105 characters.  How is this possible?

Here is the field setup:

Here is the image from the submitted form showing only the max characters allowed in the form:

Here is the workflow token from the fail workflow (failed due to DB varchar(100)) and this is 105 characters:

0 0

Replies

replied on June 27, 2017 Show version history

Good morning Chase,

I'm a little confused--is the field in the form populated via lookup?  I ask because I'm not sure where the "t toy" string is coming from between the time the form is submitted and the time its values are passed to Workflow.

I imagine that if a user was typing into the "Consequence" field, they would be prevented from entering more than 100 characters (and there'd be no issue with the value passed to Workflow), but I've seen unexpected behavior with JavaScript (which I imagine is being used by Forms to set character limits on fields) where a value passed into a field (not manually entered by a user) appears truncated/formatted/etc. on the form when filling it out in a browser, but is actually a larger or different value--almost like the value is "masked" in the browser but the variable it corresponds to is not actually assigned this masked value.

Best,

Rob

0 0
replied on June 27, 2017

This is done by the laserfiche field itself as shown in the picture.  No javascript is being used to truncate the field.  This entry is manual.  No lookup is used to pull this data.  The first entry of this data is entered via the form and submitted.  Workflow is grabbing the field data and pushing it to our database.  

Because our DB varchar is restricted to 100 chars, I've set the max on the field as the same. 

0 0
replied on June 27, 2017

Do you have any idea where the 5 mystery characters are coming from? Have you tried copying/pasting a string you know to be exactly 100 characters into the field? I am curious how those 5 extra characters are getting into workflow--it almost seems like Forms is only displaying the 100 characters but might be writing/saving to the variable whatever is typed (which could be more than 100 characters). I've seen similar behavior where I'll set a field to be all caps using some JS--it will display as expected in Forms. But once it's passed to WF, it's a combo of upper/lower that reflects the actual characters input in the field.

All I meant when I reference JavaScript in my initial reply is that whatever dynamic stuff Forms itself is doing (like setting a character limit on a field), it's almost certain doing it with JS (not custom JS that you'd add, but I'm pretty sure the entire Forms product is primarily built using a combination of JS/CSS/HTML5/MSSQL).

Anyway, in WF, if you need to truncate the string to 100 characters, you could use the Token Editor to apply a regex like:

[0-9A-Za-z!@.,;:'"?-]{1,100}

This will truncate the string to 100 characters.

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

Sign in to reply to this post.