Attachment template new row If expression?


I am using an attachment template in workflow rule.
I have multiple tables created in this template, some are only created if they have content, such as:
Which works exactly as I anticipated.

My issue now is I have a table that is always created but some rows should only be produced if they have contents. (Not doing this results in a large number of unsightly empty rows.)
Here is my attempt:
Capture2 (2)
and the result:

I am sure Im on the right track with my technique. I am unsure where to place it and would like confirmation that I am not missing anything else. As you may know templates are harder to self troubleshoot over in app issues.

Any help is appreciated, thank you.

This sounds like a problem for template master @Aleksi! :slight_smile:


There is no nice and easy way to build this because if you use IF: & EndIF formula in the row #3 for example, it just clears the row if I remember it correctly, but it keeps it as a blank row.

Unfortunately you need to create 4 separate tables where the first one is shown only if you have just two rows as Template Pty Ltd and Manager. If you have 3 rows to show, show that one etc. There is another thing to remember because any of those 3 rows can be shown or all of them, you need to add an internal IF statement which rows to show.

So… you need to have two separate IF “levels”… first one is for how many rows do you have in overall and another one is for checking what of those 3 rows you need to show. As you can see, not very nice trick.


Thank @Aleksi

So your solution to clarify is:
Table is for example 4 rows deep, then I would create 4 seperate tables.
Table 1 containing 1 row
Table 2 containing 2 rows

Using If Statements to determine how many rows contain data and so determining which size table to show?
If I am correct in my assumption of what you are saying it would turn my 20 page document into 100 pages pretty quick haha, quite a few long tables within.

My only other option I can think of is separating every row in every table into its own table and determining with an IF statement whether it contains data and hence should be shown. I think I have done something similar before but from memory the tables top and bottom edges sit next to each other turning a single pixel thick border into a two pixel thick border on the top and bottom of the table (also known as really ugly)

That is unless anyone else has a better idea

It’s true that your other option will be quite ugly because border line’s positions won’t math.

I have one idea… let me test if that could work.

@SKETCHwade If you change your template from “reading one value” to “Start: & End”, with this method you will be able to remove blank rows. Though you can write “COL#1” directly without <<TEXT(“COL#1”)>>. I was just testing it with that way for other purposes :slight_smile: