View this page in the latest version of Appian. Move Document Smart Service Share Share via LinkedIn Reddit Email Copy Link Print On This Page Overview The Move Document smart service allows you to select a document and move it to a different document folder or Knowledge Center. A document can only be moved to an existing document folder or Knowledge Center. Only a system administrator, a user with Administrator permission to the knowledge center, or the person who uploaded the document can move the document. Attempting to complete this task without sufficient rights will result in an error and pause the process. Properties Category: Document Management Icon: Assignment Options: Attended or unattended Compatible with autoscale: Yes * Configuration options This section contains tab configuration details specific to this smart service. For more information about common configurations see the Process Node Properties page. Data tab This tab displays all the Node Inputs and Node Outputs. You can add additional inputs and outputs, if needed. Node inputs The default inputs are: Input Data Type Required Multiple Document Document Yes No Destination Folder Yes No If the node is run without being assigned to a user or a group, you must specify values for each of the Node Inputs listed in the table above. You can either manually enter data into the text-field, or a value can be generated using the using the Expression Editor. If the node is assigned, the Node Input values are typed by your assigned users in a form. Usage considerations Run at low throughput in autoscaled processes This smart service is not intended for high-throughput usage and should only be used at low frequency in processes with autoscale enabled. The underlying services this node relies on may not scale to the same degree as autoscale-enabled processes, which may impact performance at high concurrency. For autoscaled processes, consider one or more of these approaches: Position this node in less used paths within your process flow. This could be an exception path or an uncommon case for the process. Monitor node execution times during performance testing to see if the node performs differently at scale. When used in an autoscaled process, the node should behave as it would in a standard process of comparable scale. For typical workloads, no special design considerations are needed. a!moveDocument() The Move Document smart service is available as an expression function that can be executed inside a saveInto on a Interface Component or as part of a Web API. Syntax a!moveDocument( document, destination, onSuccess, onError ) Parameters Keyword Type Description document Document The document to move. destination Folder The new parent folder for the selected document. onSuccess Any Type A list of saves or an HTTP response to execute after the smart service executes successfully. Created with a!save() or a!httpResponse(). onError Any Type A list of saves or an HTTP response to execute when the smart service does not execute successfully. Created with a!save() or a!httpResponse(). Example: Move documents to a document management record type In an existing application, you may already have documents stored in folders. However, you may want to move those documents to a document management record type so you can take full advantage of smart search. This example walks you through a scenario that requires a new process model to move documents from an existing folder to a generated document folder for a document management record type. Scenario In this example, we have an existing record type called AT Receipt that stores the document identifiers for all receipts in a documentId field. We just changed the data type of the documentId field from type Number (Integer) to type Document, which generated a new document folder for the record type. While the record type references the existing document identifiers, the documents themselves are not associated with the record type yet. To associate the documents with the record type and apply the record type security to the documents, we need to move the documents to the generated document folder for the AT Receipt record type. This example creates the following process models: A subprocess to move the documents. A process to query and batch through all document identifiers in the record type and execute the subprocess. Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to close Subprocess to move documents In this example, we need to move more than 1,000 documents, so we must use a subprocess to execute the Move Documents smart service multiple times. To build the subprocess to move documents: Create a process model. In this example, the process model is called AT Move Document Subprocess. Add the process variable below: Name Type Value Parameter? Required? Multiple? document Document (data type) Leave blank Yes No Yes Drag in a Move Document node and configure the following: Go to the Data tab. Click the Document input and set the Value to pv!document. Click the Destination input and configure the Value with a!documentFolderForRecordType(). For example: 1 2 3 a!documentFolderForRecordType( recordType: recordType!AT Receipt ) Go to the Other tab. Select the Automatically run multiple instances of this node checkbox. Select the Run one instance for each item option and use the dropdown to select the document process variable. Click File > Save & Publish. The process model should look like this: Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to close Process to get documents and run the subprocess After building the subprocess to move documents, we can build a process model to query the documents that need to be moved and run the subprocess. To create this process: Create another process model. In this example, the process model is called AT Get and Move Documents. Add the process variables below: Name Type Value Parameter? Required? Multiple? startIndex Number (Integer) 1 No No No document Document (data type) Leave blank No No Yes Add a Script Task node and configure it as follows: For Name, enter Get Documents. Go to the Data tab and select the Outputs tab. Click + New Custom Output. In Expression, enter a query to return the document identifiers from the record type. In the query, set the startIndex parameter in a!pagingInfo to pv!startIndex so the process can batch through all documents. For example, the query could look like this: 1 2 3 4 5 6 7 8 a!queryRecordType( recordType: recordType!AT Receipt, fields: recordType!AT Receipt.fields.documentId, pagingInfo: a!pagingInfo( startIndex: pv!startIndex, batchSize: 1000 ) ).data[recordType!AT Receipt.fields.documentId] For Target, select the document process variable. Add an XOR node after the Get Documents node. You'll configure this node in a later step. Add a second connector from the XOR node back to the Get Documents node. Add a Subprocess on the second connector and configure the following: For Name, enter Move Documents. Go to the Setup tab. For Run this process model, select the Move Document Subprocess you created earlier. For Input Variables, use the dropdown to select the document process variable. Add a Script Task node on the connector between Move Documents and Get Documents and configure the following: For Name, enter Get Next Batch. Go to the Data tab and select the Outputs tab. Click + New Custom Output. In Expression, enter pv!startIndex + 1000. For Target, select startIndex. Open the XOR node and configure the following: For Name, enter Docs to Move? Click NEW CONDITION. For Condition, click Edit as Expression and enter a!isNullOrEmpty(pv!document). For Result, select End Node. In the Else if no rules are TRUE row, set the Result to Move Documents. Click File > Save & Publish. The process model should look like this: Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to close Run the process model to move all documents to the new document folder. Tip: To avoid interrupting application users, run the process model outside of peak traffic or working hours. After executing the process model, all documents will appear in the Documents page of the document management record type. You can then configure record-level security on the document management record type to apply more granular access control to your documents. Feature compatibility The table below lists this smart service function's compatibility with various features in Appian. Feature Compatibility Note Portals Partially compatible Can be used with Appian Portals if it is connected using an integration and web API. Offline Interfaces Incompatible Sync-Time Custom Record Fields Incompatible Real-Time Custom Record Fields Incompatible Custom record fields that evaluate in real time must be configured using one or more Custom Field functions. Process Reports Incompatible Cannot be used to configure a process report. Process Events Partially compatible If autoscale is enabled, can be used to configure a supported process event node (such as a start event or timer event). Event Consumer Filter Conditions Incompatible Cannot be used in filter conditions. Event Consumer Event Handlers Incompatible Cannot be used in event handler expressions. Feedback Was this page helpful? SHARE FEEDBACK Loading...