AutoStore: Data Filter Reformat Date
AutoStore can reformat a date during runtime without a process script by using the Data Filter process component.
Every day around the world, millions of people save files with a file name. A task so common, so routine, it's easy to forget that certain characters can be problematic.
Here is some additional information on this topic from a Windows perspective:
Naming Files, Paths, and Namespaces
https://msdn.microsoft.com/en-us/library/aa365247
My previous post described how we could create a custom RRT with an AutoStore VB/JScript process script. The scenario began with an AutoCapture date field, its value was formatted as mm/dd/yyyy, and needed to be part of the file name.
Those slash (/) characters in the date would not work as-is for the file name. So, the script reformatted the date as yyyy-mm-dd, which is friendly for a Windows file name. In this post, we'll produce that very same result using the Data Filter process component.
We'll start with a configuration that contains AutoCapture capture component, the Data Filter process component, and the Send to Folder route component.
Go to the Data Filter process component through the capture component by selecting the form. Our example form was named Vendor Invoices with the following fields:
- Vendor Name
- Invoice Number
- Invoice Date
In the Data Filter configuration, set the Activate selection to Yes. When we click on the Add button, a list of various filters is displayed. For this example, we'll choose the Format Date filter.
This opens up the Format Date filter dialog, and there are three primary fields to configure.
- Field name – This is the name that will be used for this filter. The name we assign here will show up in the Available RRTs list for the Data Filter.
- Input – This field is for the value that will be reformatted. This input value must be a date expression, and would be an actual RRT in useful cases.
- Format – This is where the date format is defined.
There's also a checkbox to fail the job if the input or the output is invalid. Given that we're working with the Format Date filter, it will try to reformat a valid date expression, so anything that cannot be evaluated as a date would cause a processing failure.
Here are a few examples of valid date expressions for input:
- 10/27/15
- 10-27-2015
- October 27, 2015
We'll configure this filter to reformat the value of an AutoCapture date field named Invoice Date which would have a date format of mm/dd/yyyy. So, we'll enter "InvoiceDate" into the Field name textbox, and add the AutoCapture RRT to the Input textbox.
Special date-parts that would make up a desired date format would be added to the Format field. When you click on the Insert button, a list also provides some preconfigured formats to choose from. Choose the yyyy-MM-dd option so that no slash (/) characters part of the date.
Selecting one of these formats then adds those date-parts into the Format field, including those static hyphen (-) date separation characters. Each respective date part is preceded with a percent (%) character, and is represented as a single character.
Click OK to complete the Format Date filter setup, and OK again to complete the Data Filter process component configuration. Now, the Data Filter InvoiceDate RRT is available for use. The following example represents the file rename schema for the Send to Folder route component.
~ACC::%Invoice Number%~ ~DFT::%InvoiceDate%~ ~STF::Counter~~STF::FileExt~
The configuration is now completed, ready to be saved, and tested. We should now see the date in the file name formatted as yyyy-mm-dd.
In earlier days before AutoStore 6, one needed their scripting pen to do so many things found in the Data Filter, such as reformatting a date value to pass downstream to other workflow components. Today, the Data Filter makes it fast and easy to tighten up an AutoStore configuration.
Gracias!
ReplyDeleteIm Evaluating autostore 7, but i need to use cover sheets with barcode name of document, using barcode process, i have not found any sample to implementing, do you have some one? thanks
ReplyDeleteThank you José. Check out the following video I did in July 2014 which runs through the basics of the Barcode process component:
DeleteBarcode Page Split
https://www.youtube.com/watch?v=9LSt7AG1JGE
Hopefully, you will find it helpful.
Thanks a lot, it works for me, the only question is, how can manipulate barcode value on Form_OnValidate(Form) in a autocapture form?
Delete:D
Hi José, the document goes into the Barcode 'process' component only 'after' the document has been captured. Given that, we really would not be able to do anything with the barcode value on the document itself while it is being introduced into the 'capture' component, which would include Form_OnLoad or Form_OnValidate event handlers.
DeleteThat said, 'QuickCapture Pro' is a scanning application which uses the AutoCapture component. QuickCapture Pro has the ability to read the barcode on the page, and the user can 'snap-in' that barcode value (even text too) into a form field by clicking on it. Now when the job is submitted, any code you add into the Form_OnValidate event can be called.
Thank you, i will check it out,
ReplyDeletebest regards
another stuff, my process is docushare, but i need to evaluate name of document to validate captured metadata, well i'll first check that video.
ReplyDeleteregards