E-mail Template for Dynamic Table

I’ve browsed the forum, and I have found examples that get me close, but not specifically what I need. Looking to the group for help.

I’ve got an 80+ question survey app, that users will return yes/no responses on, with photos as follow-ups to some of the questions asked. I’ve built a workflow that allows the user to ‘flag’ a survey and will generate an e-mail report with the results. Given the amount of data on the survey, I want only ‘no’ responses to display on the report.

Currently, I use a Word template, with a table containing two columns, with expressions such as:

Column 1
<<If: [Question 1] = “No”>>
Question 1
<>

Column 2
<<If: [Question 1] = “No”>>
<<[Question 1]>>
<>

My issue, is that if they return a large series of ‘yes’ answers, then the PDF report (and e-mail), have large areas of blank rows, or condensed table lines. I would like to have a clean, dynamic table that only lists the values in the cells that return a match to the “if” statement.

Perhaps an expression or a way to delete or hide the line if a ‘No’ value is returned?

Any help would be appreciated!

Thanks

Try it by putting the IF statement on the same line as the previous ENDIF.

1 Like

Hi @D.harrier
Would basing your template on a “no” Slice be any easier?

I was unable to get it to format correctly using the If statement on the same line as previous ENDIF, as the cell still is an empty value, and thus creates the “collapsed look”
Capture

With regards to the slice, if I sliced the data to only equal the ‘no’ values, then reported on those for the export, how would I add the photos that are optional for each of those results? They are reported in a separate column, such as [Question 1 - Photo].

Thanks

Ah, didn’t know you were putting it in table cells. Can I see a screenshot of that section of your template?

I don’t believe you’ll be able to use a slice for this issue. Slices provide two functions

  1. Filter out rows according to certain column values.
  2. Show only a static set of columns.

Neither of these are what you want, what you’re wanting is essentially to filter out certain columns if they are “No”

1 Like

Thanks for the help again, see below example:

I would do something like this:
image

Unfortunately the cells won’t be connected to each other this way. I suggest hard-coding the cell widths (right click -> table properties), and/or making the border colors white (or same as your background) to hide them.

1 Like

Thanks for the reply. I attempted this, but I am still getting blank cells on the PDF report when a condition isnt met.

Perhaps we can look at this a different way…

Would it be possible to make the table only generate a line, IF the condition is true?

Please post your latest template.

Hi @D.harrier
Have you tried this

You’ll run into a similar issue using an IF expression as using an template-IF. Its all about how you enter in the line breaks and cells/table relative to where the expression is. I’ve successfully done almost exactly what I suggested above, without extra spaces/cells/tables. I’m sure it is just a small formatting issue.

Although we could simplify the issue by having to only use one expression per column, like Lynn’s suggestion. Consider this template:

image

Notice that the line breaks are explicitly written inside of a text string, and I open the angle bracket expression on the same line as the previous, any line breaks inside the angle brackets are not read as line breaks in the output (except for the text string line break).

2 Likes

Thank you for your help!

I was able to get it to work, if I created individual table lines, similar to what you added above, but then the IF expressions were outside of each table row, like you have.

3 Likes