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

Question

Question

retrieve value changes date format

asked on July 30, 2021

We will soon begin a bulk scanning operation to convert several million pages into electronic format. I have created a workflow to classify documents by type. When the Bulk Input workflow is unable to determine the document type, the document is placed in a separate location in the repository for manual review. I created a Manual Review workflow that runs only when an end user reviews a document in the manual review folder and changes metadata.

I have some documents that need to be listed in the repository in order by a date that is extracted from within the document. I store that date in the metadata and also in the document name. I set the date format of the field in the template and the token used in the document name to yyyy/MM/dd.

When the end user reviews one of the documents in the manual review folder and changes the document type, they can also change the date field. I use a retrieve value activity in the Manual Review workflow to retrieve the changed date from the metadata for placement in the document name. Even though the date format in the template is set to yyyy/MM/dd, the date is retrieved and stored in the name as mm/dd/yyyy.

Is there an easy method for ensuring the date is stored in the metadata, retrieved, and assigned to another token in the same format?

0 0

Replies

replied on July 30, 2021

Date formats in template fields is for display only. When editing values, the desktop client will use the format specified in Windows settings on the machine where the application is installed, while the web client will use the browser settings.

Dates are stored in SQL in invariant format (yyyy-MM-dd), Workflow uses the Windows date format for the user specified in the Workflow Server service login (which in the US defaults to MM/dd/yyyy). If you need to use it as a text value, such as a document name or folder path, you will need to format it to how you want it displayed (and it will not change according to Windows/browser settings anymore).

1 0
replied on July 30, 2021

The format used to display the date in the field is really just a mask.

Internally datetime values are always stored in the same format within the database and I think workflow uses the system settings when reviewing date/datetime/time values for consistency.

If you want to enforce a different format when using values in plain text like document names, right-click and use the token editor to apply formatting so you always get the desired format.

 

0 0
replied on July 30, 2021

Thanks, Jason,

I found that I don't actually have to use the token editor. All I have to do is specify the format as you did above when referencing the token, e.g.,

0 0
replied on July 30, 2021

The token editor is kind of just an interface to ensure things are formatted properly, so technically you can enter it manually if you know the syntax.

I typically prefer to use the editor to just to make sure I don't miss a " or # or any other character that could break things, especially when you get into more complex stuff like stacking functions, indexing, regex, etc.

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

Sign in to reply to this post.