CMDBuild Forum

openMAINT: Importing csv not working when data/assets have relations

Hi,

I am trying to import data using “Utility-> Import csv file” but does not work when data do have relations (example Network device has relation “connected to” a network device). There is no error message but a success message.
Is there a trick/way to do the multiple data entry using a csv file when data have relations?
I couldn’t find a related post in english in forum. We are using openMAINT 2.5.1 but noticed also in previous version 2.4.2.

Thank you,
Antreas

First of all you must to have the target reference registers. If you haven’t or you have a mess of relations, you can import a little csv without reference attributes. And then you can update with your whole csv with reference attributes.

All classes inherit the field code and description. When you configure this column/attribute at csv, you must to choose between these options to link with the reference class and jotdown in consecuence of it

image

(About the bold font, I’m mistake)

Thank you for your quick reply. However, I cannot understand what to do. For instance how to open the UI in your screenshot. I was looking for it just in case it might help me understand what to do but did not find it. I appreciate any clarification in advance (in Spanish is OK also)

About where is it the UI
In the administration area, select a class and…
image

Por ejemplo el atributo InvResponsableMant

  • Es un REFERENCE, la parte 1 de una relación n:1.
  • No obligatorio
  • Y con código/Descripción elijo qué deseo escribir en el CSV para su importación, qué quiero usar como foreign key.(fk) para que CMDBuild lo interprete

En tu caso, Si tienes 2 clases relacionadas 1:n, por ej. Propietario y Edificio

  1. Importante, el atributo con la fk no puede ser obligatorio
  2. Crea las plantillas CSV de clases. La de edificio sin el atributo fk o reference (edificio.propietario_fk)
  3. Sube todos los objetos con esas plantillas.
  4. Ahora ya deberías de tener todas las clases sin relacionar.
  5. Duplica la plantilla CSV de edificio, editala como import-export y añade el campo propietario_fk
  6. Descarga el CSV de edificio con esta nueva plantilla
  7. completa los valores de propietario para cada edificio. Si has elegido Code/Código con el valor de la columna Code de la clase propietario
  8. Sube el CSV con los datos cubiertos
  9. Y listo
    image

Hola, muchas gracias por tu respuesta, pero no tengo la pestaña “importación / exportación”. Como puedo installarla?

Lo siento, creo que yo NO te puedo ayudar
¡Ups! No me había fijado te referías al OpenMaint1.X (OPM) basado en CMDBuild 2.5.1
Ahora mismo tengo desmontada esa versión de OPM y no recuerdo cómo funcionaba.

(Esa pestaña sólo funciona para clases, no para superclases)