Google Doc from template - hide empty variables

  • We’re passing form fields from a Tally form to a Google Doc template.
  • Some fields are optional in the Tally form
  • The Google Doc template obviously contains ALL placeholder variables
  • yet, when fields are left empty, the {{field-with-no-content}} just shows as its placeholder variable in the generated Google Doc.

How can we suppress placeholders in the generated file of form fields that have been left empty?
And would we do that in the Google Doc template, or the connection data within MAKE via functions?

Hi @nadworks
A doc template would have the placeholder hard coded there, so it would be tough.
Might I suggest perhaps using an html template and then with the help of conditional rules on Make remove the placeholders if empty.


Yes, thanks. Was almost dreading this answer, but I guess there’s no other way, hm?


Have you tried replacing the fields that will have no content with {{empty string}} or {{null}}?


Do you mean in the Doc?
I don’t know which ones will be empty. They’re just non-mandatory fields in a creative brief form. The user can leave some fields blank.

In Make, in the Google Doc module, instead of leaving a field blank, fill it in with {{emptystring}} instead of nothing. Hopefully that would prevent it from displaying the placeholder text.


I probably wasn’t clear.
I’m not leaving anything blank is the Google Doc module of the Make scenario.
The Google doc template has a number of {{variables}}, which reference completed fields from a Tally form. All fields have to be captured in case they get filled in, but not all are mandatory. When a field is not completed in Tally (and we obviously don’t know which ones a user might not complete), the Google doc that’s generated from the form submissions show the original {{variable}} instead of just an empty section.

I cannot explain it any better. But adding {{emptystring}} anywhere in the Google Doc module makes no sense.

I was perhaps not clear either…

Let’s say this is my template Google Doc

In Make, if I didn’t have anything for Item 3, I’d use {{emptystring}}.

And the result is:

It still leaves a blank, but not the placeholder text.
I’ll show a way to handle this in another reply.


So, if you want to avoid this whitespace issue, instead of filling the placeholder with {{emptystring}}, fill with something more random, like <remove me please>, anything that looks like it would be out of place.

Use a Google Docs Make an API call module after the Create a Document from a Template Module configured like this:

The Document ID comes from the previous module that just created the document.

Below, in the body, surround your custom string with {{newline}} for the “text” parameter.
Replacetext is simply “”.

For me, the result from previous example now looks like this:

Hope that makes sense, and hope it helps!


Thanks. How would that work with a Google Doc template, though, where I need specific content to go into specific places in a specific style to make up the document - i.e. a contract?

I’m sorry, I don’t understand.

Your Google Doc Template should already have a bunch of {{placeholders}} all over it, right?
You can’t really suppress them, only replace them, then possibly replace them again.

Format your document the way you want it formatted and the replaced text will keep the format the previous text was in.

Do you have some screenshots or something else you can share to give more detail/context?