How to create rows in an items table from document fields?

Tabla de contenidos

Athento allows you to create rows in an items table from document fields with their values through the following operation:

op_add_itable_row

 

To use it, it must first be installed in the space.

 

The parameters must be configured:

  • Table of items / Table-type field: Field where the created record will be added.
  • Mapping of data into itable / Data mapping in the table: Text in JSON format where the values for the table columns must be specified, either fixed values or expressions with document metadata. The columns that are not indicated in this JSON will not be filled with any value. In other words, here the column names and the values they will take are indicated. 

The format to follow in this parameter is:

{
"nombre_interno_columna1":"metadata.mi_campo1",
"nombre_interno_columna2":"metadata.mi_campo2",
"nombre_interno_columna_de_tipo_booleano":"false/true"
}

First the column, followed by the field or expression with which it must be filled. In the case of columns that contain boolean data, the value can be either true or false.

  • Columns to be evaluated / Columns to evaluate: Slugs of the columns that contain an expression as a value in the previously mentioned JSON, so that in order to calculate its final value, that expression must be evaluated. If more than one is to be evaluated, they must be separated by a comma as follows: slug_columna_1,slug_columna_2,slug_columna_3…

 

When executing it, you can see how after executing the operation, the new record is added to the specified items table:

 

Then, all that remains is to perform the necessary configuration to execute the operation wherever it is necessary to execute it.