Maintain supports three methods for importing activities:Documentation Index
Fetch the complete documentation index at: https://docs.cognite.com/llms.txt
Use this file to discover all available pages before exploring further.
- CSV upload: Import activities using the user interface (APM mode only).
- Cognite Toolkit: Ingest activities using Cognite Toolkit data modeling (APM and IDM/CDM modes).
- Transformations: Convert data from RAW tables or other sources using CDF Transformations (APM and IDM/CDM modes).
Import via CSV upload (APM mode)
Mode availability: APM mode only. IDM/CDM mode doesn’t support CSV import in the user interface.
Download the CSV file template
The imported CSV file needs to conform to your project-specific template. To download maintain-import-template.csv:
- Navigate to Activities and select Add activity.
- Select Import activities.
- Select Download template.
Populate the CSV file template
The CSV template will only contain a single row of values representing the possible values you can provide for an imported activity. This row is called the header row and shouldn’t be removed when populating the template.To import a single activity, add a new row to the template and enter the appropriate values separated by commas. Each value in the new row should contain the value you want to populate on the respective header row that was provided in the template.For example, if your template contains the following header row: You’ll create an activity with the title “Erect scaffolding”, status “Done,” and department “Rigging” when imported.If the provided external ID doesn’t export, the user will see an error during import.
title,status,department, create a CSV file with an additional row:Format date fields
Some activity fields in Maintain represent dates and must have a specific format to be properly imported. Date fields can be identified in the CSV template by a special header value in the formstartTime (DD/MM/YYYY). In this example, startTime is the name of the field, while DD/MM/YYYY is the date format that needs to be used in subsequent rows of the CSV file.For example, importing the following file will result in the activity being created with startTime set to December 10th 2023.Format boolean fields
Some activity fields in Maintain represent boolean values, such astrue or false. Boolean fields can be identified in the CSV template by a special header value in the form isActive (true/false). These fields only have two valid values, true or false.For example, importing the following file will result in the activity being created with isActive set to false.Format values containing commas
Due to the CSV format separating values using commas, be careful when an activity field also needs to contain a comma. Maintain processes CSV files according to the RFC 4180 standard, which requires values containing commas to be wrapped in double quotes.For example, importing the following file will result in the activity being created withcity set to Boston, MA.Unset values
You can leave the field blank on non-required activity fields to represent missing or irrelevant values for the specific activity.For example, importing the following file will result in the activity being created withstate set to New York, but it will have no value in the city field.Connect an activity to an asset
Maintain supports linking activities to CDF assets, which is used to contextualize the activity in 3D models, documents, PSN, and more. For Maintain to create the appropriate link to an asset in CDF, you must provide the CDF asset’s external ID in the import template.If you have asset contextualization in your project, there will be a specialassetExternalId field in the template that you need to populate with the external ID of the activity’s asset.For example, when importing the following file and assuming a CDF asset exists with external ID NY_BUILDING_23, the activity will be contextualized to this asset when ingested into Maintain.Import a populated CSV file
Once you have a populated CSV template, you can import it into Maintain:
- Navigate to Activities > Add activity.
- Select Import activities.
- Select the Click to select CSV file to import field.
- Select and upload the populated CSV file from your computer.
- Verify that you imported the file by checking the File Inspector section. A green message should show the number of rows to be imported and if you have any warnings or errors.
- If there are no errors, select Import to start the import process.
- When the import succeeds, you’ll see a green success message with the Show activities button.
- Optional. Select Show activities to navigate to the imported activities and check that they look correct according to the CSV file.
Import via Cognite Toolkit
Mode availability: APM and IDM/CDM modes. This is the recommended approach for programmatic activity ingestion.
Prerequisites
Before importing activities via the Cognite Toolkit, ensure you have:- A custom activity view configured in your data model space (or use the standard
CogniteMaintenanceOrderview fromcdf_idm) - The activity view mapped in your Maintain configuration under
viewMappings - Access to the Cognite Toolkit
Configure the activity view mapping
In your Maintain configuration, verify that theviewMappings section points to your activity view:
APM_Activity or ExtendedActivity), update the mapping to point to your custom view:
Ingest activities with the Cognite Toolkit
Use the Cognite Toolkit as the recommended approach for ingesting activities in IDM mode.Create the activity data structure
If you haven’t already, create Container, View, and Node YAML files for your activities. Follow the standard data modeling structure:
APM_Activity.Container.yaml- Defines the container schemaAPM_Activity.View.yaml- Defines the view properties and relationshipsapmActivities.Node.yaml- Contains your activity instances
Configure field mappings
Ensure your activity nodes include the required fields for Maintain:
| Field | Description | Required |
|---|---|---|
externalId | Unique identifier for the activity | Yes |
title | Activity title | Yes |
status | Activity status (for example, “Open”, “In Progress”, “Done”) | Recommended |
startTime | Start date/time | Recommended |
endTime | End date/time | Recommended |
rootLocation | Root location identifier | Recommended |
assetExternalId | External ID of linked asset | Optional |
mainAsset | Direct relation to asset | Optional |
Deploy the activities
Deploy your activity data using Cognite Toolkit:Use the Learn more about the Cognite Toolkit deployment flags.
--drop-data flag if you need to replace existing activities:Verify in Maintain
- Sign in to Maintain.
- Navigate to Activities.
- Verify that your imported activities appear with the correct data.
Ingest activities with Transformations
Mode availability: APM and IDM/CDM modes. This is the recommended approach for bulk data.
Troubleshooting
If you encounter issues with activities after ingestion, see the table for causes and fixes.| Issue | Solution |
|---|---|
| Activities not visible | Verify the viewMappings configuration points to the correct space, view, and version |
| Missing fields | Check that your Field Configuration includes all the fields you’re ingesting |
| Asset links broken | Ensure assetExternalId or mainAsset relations point to existing assets |
| Wrong root location | Verify rootLocation matches your location configuration |