Dynamic Table Constructs

Add dynamic behaviour to a table using dynamic table columns constructs to discard column or set of columns at runtime.

Dynamic table columns

Discard a column or set of columns in a table from the final generated document as follows :

Discard column if empty

Column in a table can be discarded if every element of an array in the input json is empty or null.

How to use <br/> Add discard-if-empty construct with boolean false/true along with the template tag to activate discard if empty feature for the corresponding column.

JSON representation of the input data:

Json 1

{
  "Project": [
    {
      "Name": "ABC Infra",
      "Milestone": "First Milestone",
      "DateComplete": "24/06/2021",
      "Notes": ""
    },
    {
      "Name": "ABC Infra",
      "Milestone": "Second Milestone",
      "DateComplete": "24/06/2022",
      "Notes": ""
    },
    {
      "Name": "DEF Computer Labs",
      "Milestone": "First Milestone",
      "DateComplete": "12/12/2021",
      "Notes": ""
    },
    {
      "Name": "DEF Computer Labs",
      "Milestone": "Second Milestone",
      "DateComplete": "12/12/2021",
      "Notes": ""
    }
  ]
}

Json2

{
  "Project": [
    {
      "Name": "ABC Infra",
      "Milestone": "First Milestone",
      "DateComplete": "24/06/2021"
    },
    {
      "Name": "ABC Infra",
      "Milestone": "Second Milestone",
      "DateComplete": "24/06/2022"
    },
    {
      "Name": "DEF Computer Labs",
      "Milestone": "First Milestone",
      "DateComplete": "12/12/2021"
    },
    {
      "Name": "DEF Computer Labs",
      "Milestone": "Second Milestone",
      "DateComplete": "12/12/2021"
    }
  ]
}

Adding discard-if-empty construct with boolean false/true along with the template tag to activate discard if empty feature for the corresponding column

Note: The row above the authored row will be considered as a header row. Cell from the header row will be discarded along with discarded column.

Header Row of Development Milestones table

Header Row of Conversion tracking table

Development Milestones table without header row

Discard column if condition evaluates to true

Column in the table can be discarded If condition provided in the discard-if(expr(condition)) evaluates to true. Add discard-if(expr(condition)) construct along with the template tag to activate discard if feature for the corresponding column.

JSON representation of the input data:

{
  "Conversion": [
    {
      "Month": "July, 2021",
      "Rate": 10,
      "Method": "Payout by Cheque"
    },
    {
      "Month": "September, 2021",
      "Rate": 30,
      "Method": "Payout by Cheque"
    },
    {
      "Month": "Dec, 2021",
      "Rate": 20,
      "Method": "Payout by Cheque"
    },
    {
      "Month": "April, 2022",
      "Rate": 20,
      "Method": "Payout by Cheque"
    },
    {
      "Month": "Dec, 2022",
      "Rate": 30,
      "Method": "Payout by Cheque"
    }
  ]
}

Added discard-if(expr(condition)) construct along with the template tag to activate discard if feature for the corresponding column