I have a form that collects the birthdate. I want to save the form to the repository into a folded named after the birthdate. But, I only want the folder name to contain the numbers without any slashes or dashes. I can change the default way that forms store the date in the system, but then I can't use the date filed type for template values.
Question
Question
Removing slashes from date
Replies
Hello Fay,
It sounds like you'll want to save the date within a metadata field and use Workflow to retrieve that field and use the pattern match activity to pull out the slashes.
Assuming you're using forward slashes to separate the date's components, like 7/31/2014, you can use the pattern: (\d+)/(\d+)/(\d+).
Once you've created this new "slash-less" date, you can use the token from the pattern match activity to rename the entry appropriately.
I need the slashes removed before the workflow is called. Because I need the folder that forms saves it to be named using the format of name_MMddyyy
Hi Fay,
Forms isn't currently able to reformat variables in the way that Workflow can.
One solution would be to save the form to a holding folder and then have Workflow pick it up, reformat the date, and then use the reformatted date to file and rename the document appropriately, in the way that Rob described.
Another option would be for you to use regular expressions in JavaScript to reformat the date field as soon as it's captured and stored it in a hidden field on the Form. You'll then have access to the date without the slashes within Forms. If you have experience with JavaScript, a Google search for regular expressions and date formatting JavaScript should get you started on the right path.
Hi Fay,
If your question has been answered, please let us know by clicking the "This answered my question" button on the response.
If you still need assistance with this matter, just update this thread. Thanks!