Overview
One of the best practices to follow when building stories in Tines is refactoring. In this article, we cover some simple scenarios that showcase the most common methods of optimizing your story builds.
Tines references
Before getting started, we recommend familiarizing yourself with the functionality this article covers:
Make it happen
Collapsing multiple Event Transform actions
In this video, we look at an example with four Event Transform actions. The first three are using functions to capture different aspects of the date: day, month, and year. The final Event Transform is a reference of the upstream actions' values.
Refactoring: Instead of calculating each date piece in individual actions, we use that same series of functions in the fourth "Total Info" action. Once consolidated, we are left with the same end results of day, month, and year within one action, instead of across four.
Reducing actions with functions
In this video, we look at an existing story that uses Explode, Implode, and a Condition action to check an array of spells returned from an HTTP Request action and see if the "Feast" spell is included in the array.
Note: In this video, you'll see the action referred to as a "Trigger." This action has since been renamed to "Condition action." The functionality is the same.
Refactoring: Instead of building out this logic through multiple actions, this can be done using the INCLUDES function, which returns TRUE if the target includes the specified value. Wrapping the array in TEXT first makes it easier to check with INCLUDES. We build this into a Condition action to handle both TRUE and FALSE scenarios, if needed.
Review the results
We optimize these stories by reducing the total count of actions on the storyboard. It's also easier to troubleshoot when all of the formula logic is within one action.

