Skip to main content

I’m working on a Zap that take the output of a long Microsoft Form and sends it to PDF Monkey. A bunch of the questions are long-answer with the potential for line breaks, and I’d like to convert those line breaks (“/n”) to html <br> tags. I know I can us the Formatter, but as far as I can tell, I have to do a formatter for each potential field in the Excel Spreadsheet the form dumps the responses into (the actual zap pulls form the spreadsheet, with the ”new row” trigger) 

I’d really love a simple to way to do the same replace function on every column/cell/field in the new row, without having to set up a bunch of separate Formatters for each column/cell/field or having to specify each column/cell/field in a Code zap or similar (I’ve seen some things when searching about converting it to Line Items, but that won't work in my case as it requires comma-separated values and the paragraphs I’m wanting to format would have commas inside them).

Is this doable?

Hi @cp_creative 

Good question.

1 Code step can be used.

https://zapier.com/apps/code/help


@Troy Tessalone yeh, I saw that pop up as well (and a JS script that would do what I want), but I couldn’t figure out how to have it target all the column/cell/field in my incoming spreadsheet data. Do I just leave the “input data” part blank, or do I have to specify each column/cell/field in a specific way (which is what I’m trying to avoid, but ne code block is doable, I just don’t know how to use that “input data” section)

 

 
 

@cp_creative 

You would need to create an Input Data variable for each desired field you want to run the replace function.

 


@cp_creative 

JavaScript Code Examples:

https://help.zapier.com/hc/en-us/articles/8496197098253-JavaScript-code-examples-in-Zaps