JSON.stringfy does not work - string with a lot of html codes, work?

I have this string:

COBERTURA DO CAPUZ LADO DIREITO FORD CARGO ORGINAL<br><br>Especificações:<br>LADO DIREITO<br>Código:  FC45E01926AAYYK<br>Marca da Peça: FORD<br>Linha: Pesada<br>Peça nova<br>Contém 01 peça na Caixa<br>A foto é a peça<br><br>Aplicação:<br><br>2042 4X2		27/05/13 - 30/10/19	    <br>2842 6X2		27/05/13 - 30/10/19	  <br>1317		04/04/11 - 30/01/12	    <br>1717 4X2		04/04/11 - 30/01/12	    <br>2428 6X2		04/04/11 - 30/01/12	    <br>2628 6X4		04/04/11 - 30/01/12	    <br>3132 6X4		04/04/11 - 30/01/12	    <br>2422 6X2		04/04/11 - 30/01/12	    <br>2622 6X4		04/04/11 - 30/01/12	    <br>2623 6X4		30/01/12 - 15/08/13	    <br>1319 4X2		30/01/12 - 15/02/16	    <br>3129 6X4		15/02/16 - 05/02/18	    <br>1719 4X2		30/01/12 - 30/10/19	    <br>1723 4X2		30/01/12 - 30/10/19	    <br>2423 6X2		30/01/12 - 30/10/19	    <br>2429 6X2		30/01/12 - 30/10/19	    <br>2629 6X4		30/01/12 - 30/10/19	    <br>1519 4X2		30/01/12 - 30/10/19	    <br>3133 6X4		30/01/12 - 30/10/19	    <br>1933 4X2		30/01/12 - 30/10/19	    <br>1729 4X2		13/11/13 - 30/10/19	    <br>1419 4X2		15/02/16 - 30/10/19	    <br>1731 4X2		05/02/18 - 30/10/19	    <br>2431 6X2		05/02/18 - 30/10/19	    <br>2631 6X4		05/02/18 - 30/10/19	    <br>3131 6X4		05/02/18 - 30/10/19	    <br>3031 8X2		05/02/18 - 30/10/19	    <br>1932 4X2		04/04/11 - 14/12/15	    <br>1517		04/04/11 - 14/12/15	    <br>1722		04/04/11 - 14/12/15	    <br>2632 6X4		04/04/11 - 14/12/15	  <br><br>Peça original é desenvolvida e produzida pelo mesmo fabricante do veículo e, por isso, tem todos os requisitos e características para se adaptar perfeitamente ao veículo.<br><br>*Lado direito é o do passageiro<br><br>*Lado esquerdo é o do motorista<br><br>Por favor, antes de comprar tire suas dúvidas através do chat.  Nosso horário de funcionamento é de Segunda a Sexta feira das 8 às 18:00 e aos sábados das 8 às 12:00.<br><br>Perguntas frequentes:<br><br><p class="MsoNormal" style="margin-bottom: 0cm; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;mso-fareast-font-family:&quot;Times New Roman&quot;;color:#666666;mso-font-kerning:0pt;mso-ligatures:none;mso-fareast-language:PT-BR">PRODUTO É NOVO?</span></b><span style="font-size: 12pt; font-family: &quot;Segoe UI&quot;, sans-serif;"><o:p></o:p></span></p><p class="MsoNormal" style="margin-bottom: 7.5pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;mso-fareast-font-family:&quot;Times New Roman&quot;;color:#666666;mso-font-kerning:0pt;mso-ligatures:none;mso-fareast-language:PT-BR">Sim, trabalhamos somente com peças novas eoriginais. Não trabalhamos com produtos usados..</span><span style="font-size: 12pt; font-family: &quot;Segoe UI&quot;, sans-serif;"><o:p></o:p></span></p><p class="MsoNormal" style="margin-bottom: 7.5pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;mso-fareast-font-family:&quot;Times New Roman&quot;;color:#666666;mso-font-kerning:0pt;mso-ligatures:none;mso-fareast-language:PT-BR">GARANTIA:</span></b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;mso-fareast-font-family:&quot;Times New Roman&quot;;color:#666666;mso-font-kerning:0pt;mso-ligatures:none;mso-fareast-language:PT-BR"><br>Todos os nossos produtos possuem 90 dias de garantia de fábrica.</span><span style="font-size: 12pt; font-family: &quot;Segoe UI&quot;, sans-serif;"><o:p></o:p></span></p><p class="MsoNormal" style="margin-bottom: 7.5pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;mso-fareast-font-family:&quot;Times New Roman&quot;;color:#666666;mso-font-kerning:0pt;mso-ligatures:none;mso-fareast-language:PT-BR">NOTA FISCAL:</span></b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;mso-fareast-font-family:&quot;Times New Roman&quot;;color:#666666;mso-font-kerning:0pt;mso-ligatures:none;mso-fareast-language:PT-BR"><br>Todos os produtos são enviados com nota fiscal no nome do cliente</span><span style="font-size: 12pt; font-family: &quot;Segoe UI&quot;, sans-serif;"><o:p></o:p></span></p><p class="MsoNormal" style="margin-bottom: 7.5pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;mso-fareast-font-family:&quot;Times New Roman&quot;;color:#666666;mso-font-kerning:0pt;mso-ligatures:none;mso-fareast-language:PT-BR">O ENVIO É IMEDIATO?</span></b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;mso-fareast-font-family:&quot;Times New Roman&quot;;color:#666666;mso-font-kerning:0pt;mso-ligatures:none;mso-fareast-language:PT-BR"><br>Nossos produtos são coletados pela logística do mercado livre, assim sãocoletados de segunda a sexta em horário comercial.</span><span style="font-size: 12pt; font-family: &quot;Segoe UI&quot;, sans-serif;"><o:p></o:p></span></p><p class="MsoNormal" style="margin-bottom: 7.5pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;mso-fareast-font-family:&quot;Times New Roman&quot;;color:#666666;mso-font-kerning:0pt;mso-ligatures:none;mso-fareast-language:PT-BR">INSTALAÇÃO:</span></b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;mso-fareast-font-family:&quot;Times New Roman&quot;;color:#666666;mso-font-kerning:0pt;mso-ligatures:none;mso-fareast-language:PT-BR"><br>Recomendamos a instalação feita por um profissional;<br>Não nos responsabilizamos pelo mau uso dos produtos. Isso resultará na anulaçãoda garantia.</span><span style="font-size: 12pt; font-family: &quot;Segoe UI&quot;, sans-serif;"><o:p></o:p></span></p><p class="MsoNormal" style="margin-bottom: 7.5pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;mso-fareast-font-family:&quot;Times New Roman&quot;;color:#666666;mso-font-kerning:0pt;mso-ligatures:none;mso-fareast-language:PT-BR">DEVOLUÇÃO:</span></b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;mso-fareast-font-family:&quot;Times New Roman&quot;;color:#666666;mso-font-kerning:0pt;mso-ligatures:none;mso-fareast-language:PT-BR"><br>Caso seja necessária, o produto deverá ser devolvido com a embalagem original esem uso.</span><span style="font-size: 12pt; font-family: &quot;Segoe UI&quot;, sans-serif;"><o:p></o:p></span></p><p class="MsoNormal" style="margin-bottom: 7.5pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;mso-fareast-font-family:&quot;Times New Roman&quot;;color:#666666;mso-font-kerning:0pt;mso-ligatures:none;mso-fareast-language:PT-BR">BENEFICIOS DA EMPRESA:</span></b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;mso-fareast-font-family:&quot;Times New Roman&quot;;color:#666666;mso-font-kerning:0pt;mso-ligatures:none;mso-fareast-language:PT-BR"><br>Uma empresa autorizada FORD, a mais de 20 anos no mercado, levando qualidade econfiança aos nossos clientes.</span><span style="font-size: 12pt; font-family: &quot;Segoe UI&quot;, sans-serif;"><o:p></o:p></span></p><p class="MsoNormal" style="margin-bottom: 7.5pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;mso-fareast-font-family:&quot;Times New Roman&quot;;color:#666666;mso-font-kerning:0pt;mso-ligatures:none;mso-fareast-language:PT-BR"><br><b>DADOS DA EMPRESA:</b></span><span style="font-size: 12pt; font-family: &quot;Segoe UI&quot;, sans-serif;"><o:p></o:p></span></p><p class="MsoNormal" style="margin-bottom: 7.5pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;mso-fareast-font-family:&quot;Times New Roman&quot;;color:#666666;mso-font-kerning:0pt;mso-ligatures:none;mso-fareast-language:PT-BR">Razão Social: AVECAM COMERCIO DE VEICULOSLTDA.CNPJ: 05.332.988/0001-00<br>Endereço: rodovia Pr 323 Km 308,6 2536<br>Pq Indl Nv Horizonte<br>Cidade: Umuarama PR<br>CEP: 87507-000 <o:p></o:p></span></p><p class="MsoNormal" style="margin-bottom: 7.5pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;mso-fareast-font-family:&quot;Times New Roman&quot;;color:#666666;mso-font-kerning:0pt;mso-ligatures:none;mso-fareast-language:PT-BR">Desde 2002</span></b><o:p></o:p></p>

When i try to send a HTTP POST request, i recive “JSON parameter need to be an valid JSON” error.

I Tried to use JSON.stringfy but does not work.

This is my json:

{
     "id": "{{ $json.id}}",
     "destaque": "{{ $json.descricao }}",
}

I Tried

{
     "id": "{{ $json.id}}",
     "destaque": "{{ JSON.stringfy($json.descricao) }}",
}
1 Like

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Welcome to the community @Alan_Diniz !

Tip for sharing information

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

That implies to any JSON output you would like to share with us.


To resolve,

  1. Remove the quotes when using JSON.stringfy()
  2. Remove the coma after the last property

That is the expression should be as below

{
     "id": "{{ $json.id}}",
     "destaque": {{ JSON.stringify($json.descricao) }}
}
2 Likes

Hi ihortom,

Thank you very much.

Worked removing quotes… i forget coma after last property here but dont have in my code. And the problem is the quotes “”.

Thank you =)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.