Hi. Suppose I want to use data from first three elements for an email text. When I wirte an expression, it looks like this and contains no index: {{$json["University"]}}
If I take Nodes instead of Current Nodes, it looks like this: {{$node["Function3"].json["University"]}}
If I try to add an inted like $node["Function3"][0], it gives an error.
Can I operate items data via just addressing them without multiple Function nodes?
[{
"Number": 508,
"Name": " New York University"
},
{
"Number": 460,
"Name": " Emerson College"
},
{
"Number": 272,
"Name": " Columbia College Chicago"
},
{
"Number": 259,
"Name": " University of Southern California"
},
{
"Number": 242,
"Name": " Chapman University"
}]
Just wanted to know, what’s the better way to send a message (Discord or email), saying: "Top 3 univrecities are " and take top 3 from the array. I found out, that Discord node sends a message for every item. Maybe I have to put a Function node and return the message using pure JS
If their position in the array remains constant then you can use the $items() variable. So to refer the top 3 universities (assuming that are also in the top 3 in the array), I would do something as follows
However, I have to put the Discord node as executing ONCE. And maybe because of that on execution, only the First value is shown, while second and third are blanc:
When the Once setting is off, I get all the data, but executed many times. Here’s definetely something wrong:
Yes, that is expected as it will send one message for each item. You can change that behavior by clicking on the “Settings” tab in the node (right of the “Parameter” tab) and then select “Execute Once”.
@jan Yes, this is the first what I did. But in this case the second, third and so on items via Expressions are not available in the Execution. Only the first item