Evening All. A friend suggested I might want to use Node-Red as a solution to problem i'm having but as i'm new to Node-Red, I haven't got much of a clue what i'm doing with it!
We use an online quoting tool called Quotient which can send data out via webhook - Such as this:
msg.payload : Object
object
event_name: "quote_accepted"
quote_number: 5350
title: "Configure Winman SMTP relay"
quote_url: "url"
from: "someone"
for: "company"
first_sent: "2019-11-13T16:18:21+00:00"
valid_until: "2019-11-27T16:15:00+00:00"
quote_status: "Accepted"
is_archived: false
currency: "GBP"
amounts_are: "Tax Exclusive (Inclusive Total)"
overall_discount: 0
quote_for: object
name_first: "Joe"
name_last: "N"
email: "email@email.com"
company_name: "company"
phone: object
address: object
item_headings: "Configuration of SMTP relay settings on Winman Server"
total_includes_tax: 81
total_excludes_tax: 67.5
discount_amount_includes_tax: 0
discount_amount_excludes_tax: 0
selected_items: array[1]
0: object
item_code: ""
heading: "Configuration of SMTP relay settings on Winman Server"
description: "1 hour support time (remote)"
accepted: object
accepted_on_behalf: false
accepted_on_behalf_who: ""
order_number: "PO-0173617"
comments: ""
when: "2019-11-13T16:22:28+00:00"
by: object
I've got Node-Red to receive the webhook data which is then sent on to a temple file:
<html>
<head>
</head>
<body>
<h1>Quote Accepted</h1>
<p><b>Quote Title:</b> {{payload.title}}</p>
<p><b>Organisation:</b> {{payload.for}}</p>
<p><b>test:</b> {{payload.selected_items[0].heading}}</p>
<table>
<tr ng-repeat="(key, value) in payload">
<td>{{key}}</td>
<td>{{value}}</td>
</tr>
</table>
</body>
</html>
I can access properties such as {{payload.title}} and {{payload.for}} but I can't seem to assess properties contained within the selected_items: array[1]. Ideally i would like to use ng-repeat to list any items in this array.
Any help would be much appreciated.
Thanks in advance,
Luke