Skip to main content
Question

Line items are removed from webhook


Forum|alt.badge.img

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?

Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

8 replies

Troy Tessalone
Forum|alt.badge.img+14

Hi @SARGuy 

Can you post screenshots with how the data is returned from the API step?


Forum|alt.badge.img
  • Author
  • Beginner
  • 10 replies
  • January 2, 2024

The screenshot is from the API step


Troy Tessalone
Forum|alt.badge.img+14

@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?


Forum|alt.badge.img
  • Author
  • Beginner
  • 10 replies
  • January 2, 2024

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.

 

 


Troy Tessalone
Forum|alt.badge.img+14

@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


Forum|alt.badge.img
  • Author
  • Beginner
  • 10 replies
  • January 2, 2024

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.


Troy Tessalone
Forum|alt.badge.img+14

@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.

 

Formatter > Text > Replace has these options that can be used: https://help.zapier.com/hc/en-us/articles/8496304469261-Modify-text-formats-in-Zaps#1-add-a-formatter-step-0-0

 


Forum|alt.badge.img
  • Author
  • Beginner
  • 10 replies
  • January 3, 2024

Ah, I see what you are saying. OK, sure that would probably work. Thanks, I’ll play around with it.