Question

Line items are removed from webhook

  • 2 January 2024
  • 8 replies
  • 42 views

Badge

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?


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

Userlevel 7
Badge +14

Hi @SARGuy 

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

Badge

The screenshot is from the API step

Userlevel 7
Badge +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?

Badge

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.

 

 

Userlevel 7
Badge +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

Badge

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.

Userlevel 7
Badge +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

 

Badge

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