Dynamic Table Population

Certified Senior Developer

Hi,

I am doing a process model where in I am mailing a person a table of contents.

Now the contents are dynamic, and I need to populate the contents from the process variable. I am aware about the  " ### " syntax, but not quite sure how to display multiple rows in a table. Can anyone please help me in this. 

 

Also, While reading community, I read about the ncolumntables function, but its been discontinued now. If there is a replacement for the same please suggest.

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    Use the HTML template for Email smart service. and manually form the html table data in an expression rule. supply expression rule output as input for the ### place holder(tableBody in the below example). Hopefully this should address your requirement.

    Below is the sample HTML template.

    <!DOCTYPE html>
    <html>
    <head>
    <style>
    table, th, td {
    border: 1px solid black;
    border-collapse: collapse;
    }
    </style>
    </head>
    <body>
    <table style="width:100%">
    ###tableBody###
    </table>
    </body>
    </html>

    Sample expression Rule: 

    a!localVariables(
    local!dataDict: {
    a!map(firstName: "abc", lastName: "qwe", age: 23),
    a!map(
    firstName: "qqqq",
    lastName: "ppppp",
    age: 29
    ),
    a!map(
    firstName: "wwww",
    lastName: "vvvvv",
    age: 39
    )
    },
    local!tableBody: "<tr>
    <th>Firstname</th>
    <th>Lastname</th>
    <th>Age</th>
    </tr>" & char(10) & joinarray(
    a!forEach(
    items: local!dataDict,
    expression: concat(
    "<tr><td>",
    fv!item.firstName,
    "</td><td>",
    fv!item.lastName,
    "</td><td>",
    fv!item.age,
    "</td></tr>",
    char(10)
    )
    ),
    ""
    ),
    local!tableBody
    )

  • 0
    Certified Senior Developer
    in reply to Bhaskar Urumu

    Thanks The solution works

Reply Children
No Data