cancel
Showing results for 
Search instead for 
Did you mean: 

Copy a document within a Unity Script

Not applicable

Hi,


I currently need to re-index 15'000+ documents. My first doctype has a KW 'reference' that can have up to 12 instances . I have 12 instances of 'reference' I need to copy the file 11 times and re-index the main files and all the copies with one of the reference.

All the documents are already identified and will go through a workflow that runs a Unity script. In that script, I create a list of the instances of all the references. Then I need to copy the document currently in the Workflow and re-index the copy on one of the 'reference'.

Is there any way to duplicate / copy a document in the Unity Script ?


Any help / idea would be appreciated 🙂

1 ACCEPTED ANSWER

Adam_Kuhn
Star Collaborator
Star Collaborator

In that case, you will need to use the methods exposed by the Storage class to loop the creation of a new Document as many times as you need new documents created -- for each process, you can capture the PageData and Keywords from the originating document and apply them to the new document. There are no direct copy or duplicate methods exposed by the API.

View answer in original post

6 REPLIES 6

Shane_Cook1
Star Contributor
Star Contributor

Please add an example scenario to help the community respond. Think about identifying: the number of documents, how will you "find' the documents, are the documents in workflow, is this a one-time process or on-going, do you want a copy of the document or is re-index sufficient, what specifically do you want to do to the documents found.

Adam_Kuhn
Star Collaborator
Star Collaborator

I'd echo Shane's request -- in order to give a useful answer, it would be helpful to know more about the business case, etc.

Adam_Kuhn
Star Collaborator
Star Collaborator

So if I'm understanding you properly, the process is as follows:

  1. A workflow script executes against a single Document X.
  2. The script creates a generic list of Keywords taken from Document X.
  3. The script creates 11 new Documents, each of which is a copy of Document X.
  4. The script reindexes Document X.
  5. The script applies a value from the generic list to each of the new documents.


Is that correct?

Adam_Kuhn
Star Collaborator
Star Collaborator

In that case, you will need to use the methods exposed by the Storage class to loop the creation of a new Document as many times as you need new documents created -- for each process, you can capture the PageData and Keywords from the originating document and apply them to the new document. There are no direct copy or duplicate methods exposed by the API.

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.