Getting the Last Entry from Table Data

Scenario

This recipe retrieves the last row of a Table Data macro when the table is dynamic in size and uses Scaffolding Table Data and Text Data macros in the reporting process.



Result


Recipe

Ingredients

Add-ons

Reporting, Scaffolding 

Platform

N/A

Level

EASY

Estimated time

10 minutes

Macros

Suppliers

Storage format

Macro structure

You can recreate the example in the editor view:

Steps

  1. Let's start by creating a dynamic table which allows a user to enter data.
    Create a Table Data macro with the name "mytable".
  2. Inside that Table Data macro, create a table with one column and two rows. Like this:

    Test

  3. Now create a Text Data macro under the "Test" column.
  4. For the Text Data macro, set the Field Name parameter to "mytext", type to "line", and Content to "text".
  5. Outside the Table Data macro, create a Report Block macro.
  6. Within the Report Block macro, create Local Reporter macro and set the Key to "@self".
  7. Within the Report Block macro, create a Report Body Macro, and type "Getting the last entry from Table Data macro:".
  8. Still within the Report Body macro, create a Report Info macro and set the Key to "data:mytable > collection:last > data:mytext".