​There may be thousands of images for asset, work order, and other objects to be imported into Calem when migrating from an existing CMMS/EAM solution after years of usage. This blog discusses an approach to add massive number of images to Calem. The approach requires some programming skills. For instance, using scripting language to manipulate files.

1. Drag and Drop Not Practical

Calem provides a drag and drop screen to add more than one image and file to Calem as shared docs (see this blog), or as attachment to an object (asset, work order, etc). However, it is not practical when dealing with thousands of images or files.

Another option is to build out files in Calem server, and upload excel to Calem to link the files with objects (asset, work order, etc.) in Calem.

An attachment in Calem consists of a file and a database record. 

  • A file stored in Calem_Home/server/upload_files/attachment/fkey_filename where "fkey" is a sysem generated key for the file, "_" is the separator, "filename" is the file name. For instance, "9308d3ff-0446-08ad-5fd6-a16831b24899_bitmap.png" where "9308d3ff-0446-08ad-5fd6-a16831b24899" is the system key, "_" is the separator, and "bitmap.png" is the file name.
  • A database record is created to link the file to an object. For instance, the database record for the file "log.txt" has "File uploaded" as the file name, "fskey" as the system generated key. The file is linked to asset via the "Parent" field which is the Id of the asset "100HP-004".

We will discuss ways to build out the files and database records.​ Asset will be used as an example to demonstrate the approach.

2. Move Files to Calem Server

The first step is to transfer all the files to Calem server at Calem_Home/server/upload_files/attachment. Next, write a script to iterate through each file and change its file name to: MD5(filename)+"_"+filename where MD5 is the message digest algorithm.

The above steps make the files ready to be referenced in Calem.

3. Use Excel to Link Files to Asset

Follow the steps below to prepare excel file to be uploaded to Calem.

  • Menu path: Asset | Report | Asset List Report
    • Export the asset list from Calem to an excel file. This file will be used later to vLookup the asset Ids.
    • The asset list will be used in vLookup to fill out asset Id.
  • Next, download the attachment worksheet excel file and populate it.
    • Fill out the asset and file name for each file in "Asset" and "File uploaded" respectively.
    • Use vLookup to fill out the asset Id based on Asset
    • Fill out the "_fkey" field with the md5 of the file name in "File uploaded" cell.
  • ​When done, save the excel formula as values.
  • Finally, remove "Asset" column. Save the file.
  • Upload the file to Calem - see this blog.