Fill field type TABLE from the installation of an app

Hello,

I can easily fill the fields type link, data, date, etc. But when I want to fill a field type TABLE, not how.

EJM: I have two records in the function:

after_install def ():
records = [
#table_element, child table
{'doctype' 'table_element', 'name', 'CN1414', 'element_code', '4', 'field_name' 'CN1414', 'val_porcent': 10},

#table_sunat where and element_tables field is of type TABLE
{'doctype' 'table_sunat', 'name', 'T14148', 'field_name' 'T14148', 'parent_table_sunat': _ ('Document Types'),
          'element_tables': _ (_ ('CN1414'))
          },
]

I tried to fill the field element distaintas ways:
‘element_tables’: _ (_ (‘CN1414’))
‘element_tables’: _ (‘CN1414’)
‘element_tables’,’ {‘name’: ‘CN1414’, ‘element_code’, ‘4’, ‘field_name’ ‘CN1414’, ‘val_porcent’ 10}

My question is how I fill that field type TABLE?

Thanks friends…

I found the answer, how to fill in the field:

‘element_tables’:[ { ‘name’: ‘CN1414’, ‘element_code’, ‘4’, ‘field_name’ ‘CN1414’, ‘val_porcent’ 10}, ]

Fuente:
https://frappe.io/kb/app-development/insert-a-document-via-api

1 Like