How to Create Instances of Custom Objects through a Spreadsheet

This topic explains how to obtain and complete the spreadsheet used to import instances of custom objects to the system.

 

1.    Access the custom module.

2.    In the custom object section, access the page for exporting and importing instances.

 

The system displays a page where the instances of the object can be exported and imported.

 

3.    In the Export section, click Export Template (see figure below).

 

 

4.    Save the file on your computer and open it.

 

The spreadsheet contains two tabs: the Instructions tab, which contains instructions on how to complete the template; and a second tab, where instances of the object can be registered (see figure below).

 

 

The table below explains how each field in the second tab must be completed. Fields preceded by an asterisk are required.

Field

Instructions

ID

This field is disabled for editing, as the ID of the instance will be automatically generated by the system when the spreadsheet is imported.

*Type of (Object)

Select the type of instance being created from the drop-down menu. All types created for the object in the Object Types section of the Administration module will be available here.

 

Note that previously registered instances cannot have their types edited, and any changes made in this field will be ignored by the system when the spreadsheet is imported. If an instance is created with a type that is no longer registered in the system, the spreadsheet will be rejected and must be corrected before it can be imported. For instances that were already registered in the system, the "(deleted)" tag will be added to the names of deleted types.

Custom Object Attributes

The attributes displayed in the spreadsheet were previously registered in the Objects and Attributes section of the Administration module. When an attribute is not applicable to a certain object type, any information entered in this field will be ignored by the system when the spreadsheet is imported. If one or more attributes were marked as required in the system, they must be completed before the spreadsheet can be imported.

These fields should be completed according to the type of attribute, as follows:

    Attachment: Files cannot be uploaded or deleted through the spreadsheet. However, any files attached through the system will be displayed within brackets separated by semicolons. For example: [file name.pdf];[file name 2.doc].

When an instance is created through the spreadsheet, this field will be imported blank, even if it is marked as required.

    Date/Time: The format for this type of field is defined when configuring the attribute in the system. If the attribute is registered as "Date", the field should contain only the date; if "Time", the field should contain only the time; and if "Date/Time", it may contain either one. If only the date is provided, the time will be 0:00; if only the time is provided, the date will be the date on which the spreadsheet is imported. The date may be in two formats: MM/dd/yyyy or yyyy-MM-dd. The time should be in 24-hour format: HH:mm tt.

    E-mail: E-mails should be entered using a maximum of 100 characters in the following format: username@domain.com.

    Formula: This is a read-only field, so it is not possible to insert or edit values. These values will be re-calculated once the spreadsheet is imported.

    Georeference: Specify a value for this attribute by providing the coordinates in the following format:

 

To define a point:

{"type":"Point","coordinates":[-0.09046,51.51095]}

 

To define a set of points:

{"type":"LineString","coordinates":[[-0.09046,51.51095],[0,07446,44.51095]]}

 

The coordinates for the points must be entered between brackets, in the following order: "Longitude, Latitude".

    Image: Images can only be attached through the system and cannot be added through the spreadsheet. The files attached through the system will be displayed in brackets and separated by a semicolon, for example: "[image.jpeg];[image2.jpeg]".

When creating an instance through the spreadsheet, this field will be imported blank, even if it is marked as required.

    Link: Links should be entered as: http://www.domain.com or \\server\path.

    List of Options: Attributes of this type should be completed with the options available for the attribute, separated by semicolons if more than one value is accepted.

    Number: This type of attribute uses the decimal separator (".") and optionally the comma separator (",") to separate thousands. For example, the number 1200.20 should be filled as "1,200.20".

    Paragraph: This type of attribute should be completed with normal text.

    Relationship: This type of attribute can be single or multiple selection and should be completed with the alphanumeric identifier or the paths of the objects being associated. If more than one object with the same name has been registered in the system, the paths of the objects cannot be used to create relationships and the system will not allow the spreadsheet to be imported. Note that for multiple selection attributes, the paths or identifiers of the objects must be separated by semicolons (";") and no spaces when completing the cells. The identifier of each object should be preceded by "id:" with no spaces after the tag. The identifier is available through the API and can also be found by inserting the name of the object in the general search field and clicking on the corresponding entry. The identifier will be displayed at the end of the URL.

For business components, the path is specified as follows: business component level > business component type > business component name.

For perimeters, the path is specified as follows: parent perimeter > perimeter name.

For assets, the path is specified as follows: parent perimeter name > subperimeter name > asset name.

For other objects, simply enter their names.

When the spreadsheet is exported, the list of related objects might be truncated if the maximum number of characters allowed in the cell is exceeded. If the cell is not edited, the spreadsheet will be imported and all existing relationships will be kept. To edit the relationships, the ellipses and brackets must first be removed. Note that, in this case, the new relationship will be imported and any previous ones will be deleted.

    Text: This type of attribute must be completed with normal text, respecting any character limits or regular expression masks configured for the attribute in the system.

    Outline: This type of attribute should be completed with the entries using a maximum of 100 characters with each separated by semicolons. For example: Entry 1;Entry2;Entry3.

 

For details on creating attributes, see Chapter 17: Administration -> Customizations -> Objects and Attributes.

Author

This field is disabled for editing and will be automatically completed with the name and username of the person who registered the instance.

Date Created

This field is disabled for editing and will be automatically completed with the date on which the instance was registered.

Updated By

This field is disabled for editing and will be automatically completed with the name and username of the person who last updated the instance.

Date Updated

This field is disabled for editing and will be automatically completed with the date on which the instance was last updated.

 

5.    When finished, save the file on your computer. The spreadsheet must be imported for the changes to be saved in the system. For details, see Chapter 18: Custom Modules -> Custom Object Sections -> Export/Import Instances of Custom Objects -> How to Import Instances of Custom Objects through a Spreadsheet.