Skip to content

Update data files in Qlik Cloud

Overview

In this tutorial, you are going to learn how to update data file contents, spaces, and ownership.

Requirements

Note: The cURL examples in this tutorial show the command syntax for Windows Command Prompt. If you are using another command line interface, different syntax may be required for line continuation. You may also need to adjust the number and type of quotes surrounding the parameters and their values.

Variable substitution and vocabulary

Throughout this tutorial, variables will be used to communicate value placement. The variable substitution format is <VARIABLE_NAME>. Here is a list of variables referred to in this tutorial.

VariableDescription
<HOSTNAME>The hostname for the initial tenant created during account onboarding. Such as tenantname.region.qlikcloud.com.
<ACCESS_TOKEN>A bearer token for authorizing https requests to the <HOSTNAME> tenant. Can be an API key, or a token generated via an OAuth client.
<OAUTH_CLIENT_ID>An OAuth client ID for authorizing requests if using the platform SDK.
<OAUTH_CLIENT_SECRET>An OAuth client secret for authorizing requests if using the platform SDK.
<PATH_TO_DATA_FILE>The path on your local system to a data file, such as /path/to/datafile.csv.
<DATA_FILE_NAME>The name that will be displayed for the uploaded data file, for example mydatafile.csv.
<SPACE_ID>The ID of the shared space that the data file resides in.
<NEW_SPACE_ID>The ID of the shared space that you wish to move the data file to.
<DATA_FILE_ID>The ID for the data file.
<USER_ID>The ID for the user who you wish to transfer ownership of the data file to.

Update the data file

To update a file in an existing data file asset, use the data file ID and pass the new file. Optionally, you can also update the data file metadata using these endpoints and calls.

Note: When updating some data file metadata, such as the filename, the corresponding data set is not automatically updated. If your users use the Qlik Cloud hub to search for data, ensure you also update the data set.

If using qlik-cli, the response will look similar to:

Example qlik-cli response
{
    "id": "<DATA_FILE_ID>",
    "name": "<DATA_FILE_NAME>",
    "size": 24743,
    "createdDate": "2023-03-23T11:26:20.631Z",
    "modifiedDate": "2023-04-28T15:41:19.8263046Z",
    "ownerId": "637390ec6541614d3a88d6c1"
}

A 201 status code indicates the data file was updated successfully.

Move a data file to a different space

To move a data file to a different space, you need to know the file ID and the ID of the space you want to move the data file to.

A 204 response confirms that the ownership of the data file has been updated successfully.

Move all data files in a space to a different space

To move all data files to a different space, you need to know the space ID of the space the files currently reside in, and the space ID of the space to move them to.

A 204 response on each update action confirms that each data file has been updated successfully.

Change the owner of a data file

To change the owner of the data file, you need to know the file ID and the ID of the user who will own the file.

A 204 response confirms that the owner of the data file was successfully updated.

Change the owner of all data files in a space

To change the owner of all data files in a space, you need to know the space ID and the ID of the user who will own these files.

A 204 response on each update action confirms that each data file has been updated successfully.

Next steps

Now that you know how to update data files, why not look at how to delete existing data files?

Was this page helpful?