Adding Data to Multiple Selected Item Frames using CSV Export / Import

Introduction

WorkBench has the ability to select multiple items and modify some attributes and categories using the Properties dialog.

Properties
Properties for Multiple Selected Items

However, what if you wanted to add data into selected item’s FRAMES?

In this example, we will show how this can be achieved using CSV export / import.

Adding data to multiple selected item FRAMES

Create a CSV File

  • Export your item type to CSV. You only need to map the default attributes Identity, Type, Draft and Version that are already pre-set. The other attributes/frames/categories do not need to be exported.
    Export Control
    Export Items Dialog

    CSV Export Mapping
    Setting Required Attributes
  • Open the CSV file in Excel and add a column representing the new frame.
    In this example, we are adding a new frame named TEST and adding the text “My Text” in this frame for all (or selected) items.
    You could, of course, add different text content for each of these cells.

    Example CSV
    Add Frame Column to Excel

    Add a Frame in your WorkBench Project

  • If you don’t already have the frame, you can add a new frame to the item type in Project Setup now. This is the frame where we will add content en bloc.
Frame Setup
Frame Setup

Importing The CSV File

  • Select Import with the file type CSV and the required item type ensuring that the Overwrite option is set to Merge and press Import.
    Note also that there are options here to update the modification date / last modifier and also whether to add an entry to the items’ edit history.
Import Options
Import Options
Import Dialog
Import Dialog
  • Map the fields ensuring that the added frame is mapped
CSV Fields
CSV Fields
  • You will see that the new frame has been added with content for all items and the previous content remains intact
Updated Frame in WorkBench
Updated Frame in WorkBench

Import Overwrite Options When Loading from CSV, TSV or Excel

Cradle can import data from external files in different formats. One of the most common formats is CSV / TSV (comma separated value and tab separated value). When data is imported from CSV / TSV files, you can choose different import overwrite options. The option that you choose will control whether your data is imported and, if it is imported, which existing data in your database will be kept, or replaced by data from the import file.

Items and Attributes

To explain these options, let’s use a simple picture to represent an item and the attributes inside it:

Cradle item and attributes
An Item With Some Attributes

Example

Lets say in your Cradle database you have an item with the following attributes:

item in Cradle database
A Cradle Database Item with Some Attributes Set

meaning that the item in the database has values set in the 2nd, 4th, 5th and 6th attributes.

In a spreadsheet you have a row with data in columns corresponding to the 1st, 2nd and 5th attributes of the item in the database:

item in import file
An Item in an Import File with Some Attributes Set

Import Overwrite Options

Option A – Overwrite On

If Overwrite is On then, for each row in the spreadsheet or each record in the CSV / TSV file, Cradle will find the work-in-progress item (if any) and delete everything inside it, and completely replace the contents of the work-in progress item with the data from that record or spreadsheet row.

You would get the following result:

import overwrite options set on in Cradle requirement management software
Import Overwrite Options – On

As you can see, only the data from the file or spreadsheet (the yellow cells) are now in the item, all previous attributes (the blue cells) are now gone.

Option B – Overwrite Off

If Overwrite is Off then if there is an item in the database for the record in the CSV / TSV file, or row in the spreadsheet, no import will occur. If there is no item in the database for the record or row, then the result is the same as Overwrite set to On.

Option C – Overwrite Merge

This is the more interesting case!

If Overwrite is Merge then, for each row in the spreadsheet or record in the CSV / TSV file, Cradle will find the work-in-progress item (if any) and replace the attributes of that item with the columns from that row in the spreadsheet (or field i the CSV / TSV file) so any attributes in the item that have not been mapped to a column in the spreadsheet row (or field in the CSV / TSV file) will be left alone.

So the attributes that already exist in the item in the database and the attributes in the spreadsheet row or file record are merged:

import overwrite options set on in Cradle system engineering software
Import Overwrite Options – Merge

You would get the following result:

import overwrite options set on in Cradle system engineering software
Import Overwrite Options – Merge

Attributes in the spreadsheet row or file record have been loaded into the item. All other attributes in the item have not been changed.

Summary

Setting Overwrite to Merge is useful to add data to database items from an external CSV / TSV file or Excel spreadsheet. Any attributes not in the external file are not affected by the import.

To get more help importing information into Cradle, explore the Cradle help here.