■Overview
This is a flow bot that sends files attached to a kintone record via email.
The file name used when sending via email will be the file name attached in kintone.
※ This is created assuming a maximum of 3 files can be stored. If the maximum number of files increases to 5, 10, etc., you will need to increase the subsequent settings accordingly.
■Creation Method
① Select "When a kintone record is edited (Webhook trigger)" as the app trigger, set the Webhook URL on the kintone side, and test and save it.
・Webhook URL: Specify the settings on the kintone side.
・Output: Add an output and enter record['〇〇'].value[*].name in JSONPATH. ※〇〇 is the field code for the attached file.
※ Please refer to the help page for kintone's Webhook settings. https://intercom.help/yoom/ja/articles/5974741
※ Here is how to obtain JSON. https://intercom.help/yoom/ja/articles/5404443
② Select kintone from the operation that links with the app, perform the following settings, and test and save it.
・Action: Obtain the file key linked to the record.
・Subdomain Name: Enter the subdomain of the target kintone.
・App ID: Enter the App ID of the target kintone.
・Record ID: Embed the output of the record ID obtained in ①.
※ Please refer to the help page for embedding outputs. https://intercom.help/yoom/ja/articles/8223528
③ Select "Retrieve kintone record" from the operation that manipulates the database, select the target App ID, and on the next page, set it so that the record ID equals the {{record number}} obtained in ① to retrieve the record information.
④ Select "Split list-type output into individual outputs" from the operation that manipulates and transforms data, perform the following settings, and save it.
・Output to be split: Select the list of file keys.
⑤ Select "Split list-type output into individual outputs" from the operation that manipulates and transforms data, perform the following settings, and save it.
・Output to be split: Select the list of file names.
⑥ Select the operation to switch destinations, perform the following settings, and save it.
・Operation: Select the operation from ③.
・Output: Select the output named 〇〇_split count.
・Switching condition: Enter 1, 2, 3, etc., for each item according to the possible upper limit of the number of files.
⑦ Select kintone from the operation that links with the app on route 1, and perform the following settings.
・Action: Download file
・Subdomain: Enter the subdomain.
・File Key: Embed the first output of the file key split individually in ④, like {{list of file keys_1}}.
⑧ Select "Convert file name" from the operation that manipulates and transforms data, and perform the following settings.
・Value to convert file name: Select the file downloaded in ⑦.
・New file name: Embed the first output of the file name split individually in ⑤, like {{list of file names_1}}.
・Output name: Enter an arbitrary output name.
⑨ Select any email tool from the operation to send an email, and perform the following settings.
・To: Embed the address obtained in ③ if available.
・Subject, Body: Enter each. You can also embed the values obtained in ③.
・Attachment: Select "Use output" and choose the output with the converted file name from ⑧.
■Supplement
For routes 2 and 3, basically repeat the same settings as route 1 as follows:
・Download the file using the split file key.
・Reconfigure the downloaded file name using the split file name.
・Once everything is complete, attach the file with the converted file name to the email.