Word template module - Carriage Return/New Line in a form field

This process works in Google Docs Template, but I cannot use it as i only have a gmail account and the Google Drive module doesn’t work with just a gmail account. I am using the MS Word Template module and for the most part, it is doing what I want it to, with the exception of a carriage return (new line/line feed) issue I just cannot seem to get past.

I have a .docx file that is a #10 envelope. I am trying to put Address1, Address2 (if it exists), city, state and zip into a field.

In airtable I can put the “/n” when I combine them together into a string and that works in Google Docs template. MS Word Template it doesn’t using the same template.

I have a long string field in airtable that is 3 lines and my FillOut.com form takes care of the new lines when it puts into the Airtable field. This also works fine in Google Docs Template.

My MS Word file is simple and looks like this.

{{Renter_Name}}
{{Def1_Combined_Address}}

I have selected value for the MS Word Template for both fields.

Things I have tried. Everything I have tried results in the same thing. All values are on the same line as the output example below.

  1. I tried sending the whole string with carriage returns.
  2. I tried taking the individual fields and using [Address1][newline][city]
  3. I tried [Address1][carriagereturn][city]
  4. Probably a few other things.

Output example:
Bob Barker
123 Price is Right Blvd Charlotte NC

I have spent a ton of time trying to hack this and internet searches are less than helpful. Any ideas? I would presume that this should be pretty simple to do, but I am incorrect so far.

Here is the input JSON

[
    {
        "data": "IMTBuffer(115545, binary, 567c5724b72960eba375b01c6774ed634dc1d6a4): 504b03041400060008000000210005a2a3026701000053050000130008025b436f6e74656e745f54797065735d2e786d6c20a2040228a0000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "values": [
            {
                "key": "Renter_Name",
                "value": "Harry & Jill Potter",
                "valueType": "value"
            },
            {
                "key": "Def1_Combined_Address",
                "value": "4001 Highway 41 East\nCharlotte, NC 28277",
                "valueType": "value"
            },
            {
                "key": "Return_Name",
                "value": "Axis Properties",
                "valueType": "value"
            },
            {
                "key": "Return_Address",
                "value": "123 Joe Blvd\nCharlotte, NC 28210\n",
                "valueType": "value"
            },
            {
                "key": "Landlord_Name",
                "value": "Axis Properties",
                "valueType": "value"
            }
        ],
        "fileName": "recdkDGbMQ9gw1Sjl10 Day Pay or Quit Notice.docx",
        "dataSource": "form"
    }
]

Mark

1 Like

I figured I would give an update on how I got around this. At this point, I am thoroughly convinced that whoever wrote the Word Template module did not account for newline (/n) functionality. This seems pretty basic to me. My work around is reasonable for smaller multiline scenarios like mine where I am putting addresses onto #10 envelopes. I have spent at least 15 hours trying to figure out what I was doing wrong and after exhausting everything I have learned over the last 30+ years being an IT guy, I accepted that this module will not honor a line feed and looked for a way around it.

Originally I wanted my template to look like this. I would feed in a name (different font than the rest) and then the address which could be 2 lines or 3 lines. Nice. Clean. Efficient.

However, I ended up having to alter it and use this instead.

So now I either needed to figure out how to parse the text string or change up my entire backend. I would still have the issue that if there is Address 2 line (for apartment numbers, etc), that I would have a blank line and it would take away from the professionalism of what I am trying to accomplish. So it came to me on the treadmill last night that I could probably parse the string variable and get the pieces I needed. Below is how I ended up getting what I needed. Keep in mind that the incoming string from the input JSON is something like this where the /n is a new line.

So I short, I split the text string into an array using the split command and then use the get command to determine which part of the string I need. You have to use the built in newline and function commands and you also have to save the scenario before you test but it works. Not exactly the way I wanted, but it is doable.

Address 1 field - Array [1]
Address 2 field - Array [2]
Address 3 field - Array [3]

Heya @Mark_Poulton welcome to the community :wave:

I just wanted to quickly jump in and say awesome work figuring this out on your own :clap:

Also, thank you so much for keeping the community in mind and for stepping back here and sharing what you learned with us. We 100% appreciate that. :pray: