Knowledge Base

Fetch child table values using Jinja tags

  • 72views
  • February 6, 2024

Fetch child table values using Jinja tags

Jinja templating can be used to reference any field on any DocType in BizCentric. This can simply be done by calling {{doc.field_name}} on a print format, where ‘doc.name’ is the variable name for a certain field.

However, this approach does not work for Child Tables inside a DocType. This article will help you traverse and display all rows pertaining to a child table inside any DocType.

Pre-Requisites

We would require the variable name of the child table on the corresponding DocType. This can be viewed from the ‘Customize Form’ section for the required DocType.

 

We will also require the variable names of all the fields inside the child table which need to be referenced. This can be obtained from the ‘Customize Form’ section of the corresponding child table as shown below.