Remove empty lines in Google Doc template

Hi,
I’m new to Make.com and don’t know much (anything) about scripting. I have a Google Doc template with many placeholder variables, one per line. How can I remove the lines in the template when the variable is null/empty? I’ve used a formula to not display the placeholder text but it still leaves a blank line where the placeholder would be. Is there a formula I can use in the values field? I don’t want to use a html template (as I’ve seen suggested in other threads.)
Thanks for any suggestions!