CreateDocument
Generates a new document record in the Vault, which allows metadata and source file information to be initialized. This procedure supports setting document properties, types, lifecycles, and classification as part of the creation process.
To find the API names of the Documents table, get the Description column for the table Documents:
SELECT Description FROM [sys_tablecolumns] WHERE TableName = 'Documents'
The Description column will contain the API names of the Documents table. Now, use these API names to update a document, for example:
EXEC CreateDocument File = 'C:/Users/Public/document1.docx', Type__v = 'Promotional Piece', Subtype__v = 'Advertisement', lifecycle__v = 'example'
Input
| Name | Type | Required | Accepts Input Streams | Description |
| File | String | False | False | Input specifying the full file path to the source document that will be uploaded into Veeva Vault. This path should point to a local or network-accessible file, such as C:/Users/Public/Desktop/document.docx. The system supports files up to a maximum size of 4 GB. This is optional. |
| Content | String | False | True | Input that can be used in place of the File parameter. Accepts the binary content of the document as an InputStream object. This is useful for systems that stream data rather than reading from a file system. This is optional. |
| FileName | String | False | False | Specifies the document's file name, including its extension, such as document.docx or report.pdf. This value is optional when using the File input, but is required if providing the document content through the Content parameter, as the system needs the file name to assign and store the document correctly. |
Result Set Columns
| Name | Type | Description |
| ResponseStatus | String | Indicates the overall outcome of the document creation operation. Typical values can include success or failure, which can be used for programmatic handling or logging. |
| ResponseMessage | String | Provides a human-readable message detailing the result of the document creation request. This can include confirmation text, warnings, or error details to assist with debugging or process validation. |
| Id | String | The unique Vault-assigned document ID corresponding to the newly created document. This ID can be used for follow-up operations such as versioning, metadata updates, or workflow initiation. |