I have a webhook that gets weather from an API. One of the nested items returned shows up with line breaks exactly as I want it to appear when I use that item down the line. It looks like this:
Problem is, when I attempt to use that item, all of the line breaks are gone. I’ve tried a number of ways to format the text but can’t seem to get it. I know it has to be something simple?
Page 1 / 1
Hi @SARGuy
Can you post screenshots with how the data is returned from the API step?
The screenshot is from the API step
@SARGuy
Are you indicating this is correct with 5 separate lines?
Can you show how the data appears in when mapped to a following Zap action step?
Sure, this is how it comes through once I map it to [in this case] a GMail message. It’s the second line that says “TAF.” And yes, the 5 separate lines is what comes raw from the API.
@SARGuy
The field it’s being mapped to may not support line breaks without being formatted with HTML or Markdown.
We would need to see screenshots with how your Zap steps are configured to have context.
If the app action step you are using supports HTML or Markdown, then you can try using: Formatter > Text > Replace
The Webhook to the API returns the first screenshot and then is added to a “Send GMail” as such:
And returned in the format on the second screenshot. That’s all there is to it. The Replace would presumably look for spaces and replace with something but that wouldn’t work unless I can identify a line break and add HTML as a replacement to the line break.
@SARGuy
The Gmail Body expects HTML as shown in your screenshot, that means the mapped variable value would need to be formatted as HTML too.