Hiding Rows and Shifting Data Up

Hello,

I have a table where I have 5 variables irrespective of each other placed in rows along with details. The data mapper is excluding the data extraction if there is no data available. Var 1 will always be present, but if any of the other variables are missing, then i get this big blank space where there is no data, the last line is a total.

If var 4 is not there then I get this empty space between the var3 and var5, how can I shift the data up or remove all the rows so next row is moved up.

thanks

Description Text1 Text2 Text3 Text4 Text5
var1 15.00 1.00 2.00 18.00
var2 6.00 7.00 0.00 13.00
var3 1.00 1.00 1.00 3.00
var4 2.00 3.00 1.00 6.00
var5 1.00 2.00 3.00 6.00
Total

You can write a script (with the each() method) which loops through the rows (tr) of the table, then checks the value in the Description cell. if it’s empty or null, then hide the row (results.hide()).

Alternative method: Download Example

  • Extract your data in such a way that the Data Mapper skips all empty lines or lines where the Description is null.
  • Insert your detail table in Designer. Only rows with data will be inserted
  • To insert empty lines below each row, add the below script which targets the #table tbody tr selector. I have used a background color to highlight the empty rows.
results.each(function(index){
	this.after('<tr height="16px" data-repeat="" style="background-color:#8bd2da;"><td colspan="6" ></td></tr>');
});