Question
There is a task ā to send files from a table via email:
=: emailSend(to: "test@example.ru"; title: "Some email"; body: "test"; files: #file_field)
How can I send files from multiple rows of a table if I retrieved them using selectlist
?
Answer
You have several rows, each with a file field containing one or more files, and you need to send them from multiple rows simultaneously. Therefore, the array of lists obtained with selectList
needs to be concatenated using listTrain
(to get a one-dimensional list).
Example of code for sending an email:
=: emailSend(to: "test@example.ru"; title: "Some email"; body: "test"; files: $train)
train: listTrain(list: $list)
list: selectList(table: $#ntn; field: 'file_field'; where: 'file_field' != $#lc)