Automation Editor
...
Building Automations
System Utilities
Collector
7 min
the collector system utility app provides triggers and actions for aggregating items into named buckets the items can later be dumped out from the buckets the items are stored in the system's database until dumped from a bucket as an example, let's build a solution to collect news articles from cnbc and send us a single email once a day with all articles for the previous 24 hours we'll start with the cnbc trigger then use the "collect items into a bucket" to place articles into a named bucket we'll name the bucket "cnbc" and place the article titles and descriptions on separate lines that completes the first automation we'll use the default polling schedule, so it will run every 15 minutes 24 hours a day every day now we'll build a second automation that will dump out the articles and email them to us once a day first select a system utility trigger choose the date time app select the "every day at" trigger configure a time to send the daily email here we configure 10pm, based on a 24 hour clock when the automation runs at 10pm, we want to first dump out all the items from the cnbc bucket add an action and select the system utility category select the collector app choose the "dump items from bucket" action this action will emit an array of all the items in the named bucket and delete them from the database be sure to configure it with the same bucket name that contains the items now, the email action expects a single string value for the body of the email, but the collector action will emit an array so we need to convert the array to a single string also, we want to format the articles with newlines between them how did we know to do this? we didn't! we created the automation using a direct mapping from the collector's dump action to the email body and discovered we didn't like its formatting building automations can take some trial and error, plus exploration of the available actions we need a data transform array transforms can be found in the transform data app ah, the first one is what we need we map the emitted item array from the dump bucket action and also add html \<br/> new lines so the email will have the articles with line breaks between them next we search for an email action and use this one we enter a suitable subject and map the output from the array formatter to the body that's it! save the second automation at 10pm every day we will get our email containing all cnbc article titles and descriptions for the past 24 hours