Cloud Storage

As of 1 July 2020, Cloud Storage features (i.e. Box, DropBox, Google Drive, and OneDrive) are no longer available for new activations. If you had previously activated Cloud Storage Features in your K2 environment, those features are still supported and available for use; however, you will not be able to request new feature activations for any of the Cloud Storage features. Existing activations of Cloud Storage features will be deactivated on 31 December 2020.

Use the cloud storage group of service types to connect K2 to OAuth-based online file services such as Box, Dropbox, Google Drive, and OneDrive.

To enable the cloud storage features, you must log a support ticket with K2 and agree to a disclaimer. To log the ticket, please follow the steps below.

  1. Run the following SQL script against your K2 database to obtain your K2 environment variables:
    SELECT
        (SELECT DB_NAME()) AS [K2_Database],
        (SELECT
        DISTINCT LTRIM(RTRIM(REPLACE(fv.FieldValue, '/Runtime/Runtime',''))) + '/identity/token/oauth/2'
        FROM Environment.Field f INNER JOIN Environment.FieldValue fv ON fv.FieldId = f.FieldId
        WHERE f.IsDefault = 1 AND f.FieldName = 'SmartForms Runtime SSL'
        ) AS [RedirectUrl],
        (SELECT VariableValue
        FROM [HostServer].[Configuration]
        WHERE VariableToken = '[ENV_ID]'
        ) AS [EnvironmentId]

  2. Log a support ticket with the following details
    Ticket SubjectCloud Storage Activation
    Problem Description

    Please activate Cloud Storage for the following environment.

    Environment ID: {INSERT your Environment ID}

    Redirect URL: {INSERT your Redirect URL}
    Database Name: {INSERT your K2 Database Name}

    Service Type: {INSERT Google Drive, Box, Dropbox, and/or OneDrive}

  • The Redirect URL must be secured with SSL (HTTPS).
  • The Redirect URL value is case-sensitive - be sure to copy and paste the redirect URL exactly as returned by the SQL query results.
You will see the following notice if the cloud storage features have not been activated.

To configure a service instance and create SmartObjects to integrate with these services, see the following feature activation topics:

Service Keys (Service Instance Configuration Settings)

Key Can be modified Data Type Sample Value Notes
Element Type Yes Text dropbox Optional. A label for the name of the service with which you're integrating.
Log Method After Duration Yes Text -1 For internal use only. Used for logging and debugging.

Service Objects

The cloud storage service types have three service objects: File, Folder, and Service. The example below is from Dropbox, however the same service objects are created for other supported cloud storage services.

File Methods

Method Notes
Copy Creates a copy of the file.
Delete Deletes the file.
Download Downloads the file. In the Path property, specify the destination folder, including the file name and extension of the file you want to download.
Get info Gets information about a file, such as file name, description, and size.
Move Creates a copy of the file in another folder and deletes the original file.
Update tags Overwrites the tag property of the file with the contents of the specified string.
Upload Adds a new file. In the Path property, specify the destination folder, including the file name and extension with which to upload the file. (If you only specify a folder, this method will use the folder name as the file name and create the file without an extension.)

Folder Methods

Method Notes
Copy Copies all files in the folder to a new folder.
Create Creates a new folder.
Delete Deletes a folder and all the files and folders in it.
Get info Gets information about a folder, such as folder name and description.
List contents Returns a list of the files and folders within this folder.
Move Creates a new folder, copies the files and folders into that new folder, then deletes the original folder.
Update tags Overwrites the tag property of the folder with the contents of the specified string. This needs to be a valid JSON array string.

System Methods

Method Notes
Search You can search by Path and Keyword. Returns a list of matching file or folder objects.

SmartObjects

Use the File SmartObject to copy, delete, download, get info, move, update tags, or upload files. Use the Folder SmartObject to copy, create, delete, get info, list contents, move, or update tags on your cloud storage. Use the Service SmartObject to search files and folders on Box, Dropbox, Google Drive, and OneDrive.

See the following topics for examples of using these SmartObjects:

Considerations

  • You should not manually create cloud storage service instances. Use the feature activations to create your instances for: