Description
Once a document has gone through an Upload to Destination step, a field called DocURL is filled out containing the URL to a document when released to Microsoft SharePoint.
This field is filled in within the General section of a document's metadata and not the index section where it can be seen within the monitor. Below is a script that will move this into the document's Index section for manipulation.
NOTE: Modify your Metadata is only available in Capture Server Pro 1.10 and later.
Example
var fieldToSet = "DocURL";
batch.Documents.forEach(function (doc)
{
var docUrlValue = doc.Metadata["General"]["DocURL"];
if (!(fieldToCheck == null || fieldToCheck.trim() === ''))
{
builder.SetDocumentMetadata(doc.DocumentId, "Index", fieldToSet, docUrlValue);
}
});
Below are the step by step instructions on what this script is doing.
1. |
var fieldToSet = "DocURL"; |
|
First, we want to define DocURL as a variable we label fieldToSet to be used later. |
2. |
batch.Documents.forEach(function (doc) |
|
Then, we will use a forEach to cycle through each document to perform our task on all documents. |
3. |
var docUrlValue = doc.Metadata["General"]["DocURL"]; |
|
From there, you will set a new variable called DocUrlValue to the general metadata value of DocURL as mentioned in the description above. NOTE: This will only be present after an Upload to Destination has been performed. |
4. |
builder.SetDocumentMetadata(doc.DocumentId, "Index", fieldToSet, docUrlValue); |
|
Finally, we will use SetDocoumentMetadata to set the fieldToSet (DocURL) with our docUrlValue from step 3 in the Index section. |
You should now see a DocURL field shown in the monitor once a document has been uploaded to SharePoint.
Comments
0 comments
Please sign in to leave a comment.