Extract the values from this array

Simple beginner’s question on arrays

I have merged 2 code nodes into this


[
{
"available": 
"No",
"price": 
"£59.00"
},
{
"available": 
"Yes",
"price": 
"56.17"
}
]

In the email node body I want to send

{{ $(‘Edit Fields’).item.json.desc }} which works ( produc desc)

Supplier1 £59 No
Supplier2 56.17 Yes

Any help appreciated

  • n8n version: 1.59
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Render):
  • Operating system: Win 10

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:

Hey @Steve_Warburton , it is not clear to me what you are after. Do you want to know how to get the values of available and price? What is desc and how is it related to the output of the Merge node? How does “Edit Fields” relates to Merge?

It would help if you shared the workflow you have built so far to have a better understanding of your requirements.

I can only guess at this point and based on that guess suggest the following solution.

To compose the email body, I use Code node. I also assume you want your email sent in HTML format.

The resulting email body is

<h2>Suppliers</h2>
<ul>
  <li>Supplier1: £59.00 No</i>
  <li>Supplier2: 56.17 Yes</i>
</ul>

Adjust the output as needed.

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