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

DescriptionText1Text2Text3Text4Text5
var1 15.001.002.0018.00
var2 6.007.000.0013.00
var3 1.001.001.003.00
var4 2.003.001.006.00
var5 1.002.003.006.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>');
});