Practical considerations

Parse and extract data from complex JSON 

Working with arrays and nested objects is a common challenge. Automatic mode makes it manageable.

Let's say you receive a webhook event with deeply nested JSON from a third-party API. You need to extract specific fields from multiple levels of nesting:

{
  "response": {
    "data": {
      "users": [
        {
          "profile": {
            "name": "Alice",
            "contact": {
              "email": "alice@example.com"
            }
          },
          "metadata": {
            "last_login": "2026-01-15"
          }
        }
      ]
    }
  }
}
  • If you need to flatten a nested structure: "For each department object, extract the department name and then extract each employee from the employees array. Return a flat array where each object has department_name, employee_name, and employee_id."

  • If you need to filter and transform: "From the incidents array, keep only incidents where priority is 'critical' or 'high'. For each kept incident, extract the id, title, and assigned_to fields. Return an array of these simplified incident objects."

Aggregate and summarize data 

Automatic mode excels at aggregation tasks. Maybe you have an array of users and need to count how many are on the Marketing team.

Your guidance might be: "Count the number of objects in the users array where department equals 'Marketing'. Return the count as a number."

Or for more complex aggregation: "Group the alerts by severity level and count how many alerts are in each group. Return an object with severity levels as keys and counts as values."

The AI will generate code that loops through your data, applies the logic, and returns the aggregated result.

Format data for downstream actions 

Sometimes you need to reshape data to match the format expected by a downstream action or API.

For example, you might receive user data in one format but need to send it to an API that expects a different structure. Your guidance could be: "Transform each user object to match this format: username (from email, taking only the part before @), full_name (combining first_name and last_name with a space), and active (converting the status field to a boolean, true if status is 'active', false otherwise)."

The AI will generate code that performs these transformations and returns data in the exact format you need.

Remember, document transformation logic 

Even though automatic mode can be self-documenting (your guidance explains what the transformation does), it's still good practice to add notes to your action. Just like the auto generate feature, utilize one of the following to explain why a transformation is needed and what it accomplishes:

  • The action’s Description field 

  • A Note tile

If there are important edge cases or assumptions, document them for you and your team as well!

Was this lesson helpful?

Built by you,
powered by Tines

Already have an account? Log in.