I've created a script which, when a form is submitted, is triggered to create a document and replace several tags with the information from the answers.
As part of this, I create a variable which stores several answers with line breaks between them, e.g.:
if (marketingConditions.includes("Option 1")) {
marketingConditionsReplacement = marketingConditionsReplacement + '\n' + "List item 1";
}
if (marketingConditions.includes("Option 2")) {
marketingConditionsReplacement = marketingConditionsReplacement + '\n' + "List item 2";
}
if (marketingConditions.includes("Option 3")) {
marketingConditionsReplacement = marketingConditionsReplacement + '\n' + " List item 3";
}
I then have a bullet point in my document which has a reference and is replaced with:
body.replaceText("{{MarketingConditions}}", marketingConditionsReplacement);
However, the new line (as expected) does not append each of these string elements as new list items.
I want it to create this
- List item 1
- List item 2
- List item 3
if all of the conditions are true, for example.
I'm wondering if it's better to do this with an array instead, where each of them is appended as a separate item, but I'm not sure how I could use 'appendListItem' with this.
Any suggestions would be very much appreciated as I'm very new to App Scripts!

