I am having trouble reusing the table variable. It is supposed to be inside the loop so that I can send a table of related records in the send email. I understand the cause of the error is because I put the table variable assignment within the loop but is there any way to get around this?
Here is what it looks suppose to look like:
PS. sorry for that overly redacted sample.