I have a Zap that pulls information from a Task in Freshsales, then appends a URL to the end of the description field. It works fine MOST of the time, however it fails whenever the description has new lines in it. It reads the description just fine in the initial step, but when it PUTs the data back I get the error “The app returned "There was a problem in the JSON payload".”
I assume there’s some way to translate those new lines into something Freshsales recognizes, but I have no clue how to do that, and it is strange that it outputs it in that format but won’t accept it as an input.
Thanks in advance!
Best answer by SGSView original
Try using the Formatter as a Zap step: https://zapier.com/help/doc/how-use-formatter-functions
I looked at that formatter help file and it looks like there are a lot of different formatter functions (and even more in the app than are in the help file). Which one should I use?
Try this Formatter > Text > Convert HTML to Markdown
TIP: When in doubt, test it out!
Tried both that and markdown to HTML, no improvement.
You may have to try using a custom Code step to clean up the data: https://zapier.com/apps/code/help
Resolved the issue. This is an undocumented part of Freshsales API that new lines need to be encoded as \n
I will do a formatter step to replace them. Is there any out of the box formatter settings to replace everything that needs to be encoded as a slash command?
Try using Formatter > Text > Replace
Yeah, that’s what I’m doing, just wondering if, just like HTML<->Markdown there was any other mass formatter for catching characters like that (whatever thy are called). Thanks for your help.