Skip to main content

Data transformation example - Automatic mode

This article provides simple examples of how to utilize Automatic Mode in Tines.

Angela Ruhstorfer avatar
Written by Angela Ruhstorfer
Updated over 3 weeks ago

Overview

Automatic mode lets you ask Tines to decide when and how to apply transformations to your data. It’s like telling Tines to handle the heavy lifting automatically without you having to manually trigger each transformation. All you need is a little bit of prompt engineering!

Tines references

Before getting started, we recommend familiarizing yourself with the surrounding functionality this article covers

Make it happen

Scenario

Copy (CMD + c) the JSON block provided below and paste (CMD + v) it onto the storyboard (these are action tiles and will auto-populate!). Run them and see how Automatic Mode outputs results within the Events panel:

  • Fruit Example: Using Automatic Mode, we loop through an array of fruits to insert each array value into a message.

  • Email Example: Using Automatic Mode, we extract the URLs presented within an email body.


Actions

Fruit Example

{"standardLibVersion":"81","actionRuntimeVersion":"32","agents":[{"disabled":false,"name":"Automatic","description":null,"options":"{\"mode\":\"automatic\",\"input\":\"=fruit\",\"guidance\":\"Write the following sentence for each element in the array, replacing the fruit and color.\\n\\n\\\"The fruit is color.\\\"\",\"language\":\"python\",\"script\":\"def main(input):\\n sentences = [f\\\"The {fruit.get('name')} is {fruit.get('color')}.\\\" for fruit in input]\\n return sentences\"}","position":{"x":1140,"y":900},"type":"eventTransformation","timeSavedUnit":"minutes","timeSavedValue":0,"monitorAllEvents":false,"monitorFailures":false,"monitorNoEventsEmitted":null,"caseConfiguration":{"subStatus":null,"tags":[]},"recordType":null,"recordWriters":[],"form":null,"createdFromTemplateGuid":null,"createdFromTemplateVersion":null,"templateTags":[],"originStoryIdentifier":"cloud:0a13dfc5dbb71212cab0ad314b7fe531:f0064f807ac02bf877a6ff31d9b76916"},{"disabled":false,"name":"Fruit","description":null,"options":"{\"mode\":\"message_only\",\"loop\":false,\"payload\":[{\"name\":\"banana\",\"color\":\"yellow\"},{\"name\":\"strawberry\",\"color\":\"red\"},{\"name\":\"orange\",\"color\":\"orange\"}]}","position":{"x":1140,"y":825},"type":"eventTransformation","timeSavedUnit":"minutes","timeSavedValue":0,"monitorAllEvents":false,"monitorFailures":false,"monitorNoEventsEmitted":null,"caseConfiguration":{"subStatus":null,"tags":[]},"recordType":null,"recordWriters":[],"form":null,"createdFromTemplateGuid":null,"createdFromTemplateVersion":null,"templateTags":[],"originStoryIdentifier":"cloud:0a13dfc5dbb71212cab0ad314b7fe531:f0064f807ac02bf877a6ff31d9b76916"}],"links":[{"sourceIdentifier":"1","receiverIdentifier":"0"}],"diagramNotes":[]}

Email Example

{"standardLibVersion":"81","actionRuntimeVersion":"32","agents":[{"disabled":false,"name":"Email Message","description":null,"options":"{\"mode\":\"message_only\",\"loop\":false,\"payload\":{\"body\":\"<!DOCTYPE html>\\n<html>\\n<body>\\n <p>Hey [Recipient's Name],</p>\\n\\n <p>Hope you're doing well! Just wanted to send over a few links that might come in handy.</p>\\n\\n <p>The <strong>project docs</strong> are over here: \\n <a href=\\\"https://www.notion.so/project-docs\\\">Notion Docs</a>.</p>\\n\\n <p>If you need to check on any tasks or update your progress, you can do that on \\n <a href=\\\"https://trello.com/b/taskboard\\\">Trello</a>.</p>\\n\\n <p>Our <strong>meeting schedule</strong> is all on \\n <a href=\\\"https://calendar.google.com/calendar/u/0/r\\\">Google Calendar</a>.</p>\\n\\n <p>And if you run into any issues, the <strong>FAQ page</strong> might have the answers: \\n <a href=\\\"https://support.microsoft.com\\\">Microsoft Support</a>.</p>\\n\\n <p>Let me know if you need anything else!</p>\\n\\n <p>Cheers,<br>[Your Name]</p>\\n</body>\\n</html>\\n\"}}","position":{"x":1335,"y":825},"type":"eventTransformation","timeSavedUnit":"minutes","timeSavedValue":0,"monitorAllEvents":false,"monitorFailures":false,"monitorNoEventsEmitted":null,"caseConfiguration":{"subStatus":null,"tags":[]},"recordType":null,"recordWriters":[],"form":null,"createdFromTemplateGuid":null,"createdFromTemplateVersion":null,"templateTags":[],"originStoryIdentifier":"cloud:0a13dfc5dbb71212cab0ad314b7fe531:f0064f807ac02bf877a6ff31d9b76916"},{"disabled":false,"name":"Automatic","description":null,"options":"{\"mode\":\"automatic\",\"input\":\"=email_message.body\",\"guidance\":\"Extract the URLs from this message.\",\"language\":\"python\",\"script\":\"import re\\n\\ndef main(input):\\n # Use regex to find all URLs in the input HTML\\n urls = re.findall(r'href=\\\"(https?://[^\\\"]+)\\\"', input)\\n return urls\"}","position":{"x":1335,"y":900},"type":"eventTransformation","timeSavedUnit":"minutes","timeSavedValue":0,"monitorAllEvents":false,"monitorFailures":false,"monitorNoEventsEmitted":null,"caseConfiguration":{"subStatus":null,"tags":[]},"recordType":null,"recordWriters":[],"form":null,"createdFromTemplateGuid":null,"createdFromTemplateVersion":null,"templateTags":[],"originStoryIdentifier":"cloud:0a13dfc5dbb71212cab0ad314b7fe531:f0064f807ac02bf877a6ff31d9b76916"}],"links":[{"sourceIdentifier":"0","receiverIdentifier":"1"}],"diagramNotes":[]}

Did this answer your question?