Utilize Generate
Once you've written your guidance and confirmed your input data is correct, click the Generate button. The AI will process your guidance and sample input, then write Python code to perform the transformation.
You'll see the generated code appear in the code preview area, and the action will automatically run that code against your sample input to show you the output.
If the output isn't quite what you expected, don't worry. You can refine your guidance and regenerate as many times as needed. Each generation is independent, so you're not building on previous attempts.
✋ Try this: Use automatic mode
Scenario: Your company conducts quarterly access reviews. You receive data from your identity provider (like Okta or Azure AD) that contains user information with nested group memberships and application access. The data structure is complex, and you need to create a simplified dataset for a report for managers to review their team members' access.
Review generated code
Even if you're not a Python expert, it's worth glancing at the generated code. You'll often find it's quite readable and helps you understand what's happening.
The code typically includes comments explaining key steps, which makes it easier to follow. You might see loops for processing arrays, conditional statements for handling edge cases, and data structure manipulations.
If you do know Python, you can review the code for efficiency and correctness. The AI writes solid code, but double-checking never hurts, especially for critical transformations.
Use events for testing
Testing is crucial for getting your automatic mode transformation right. When you initially enable automatic mode in an Event Transform action, Tines automatically uses the last event received by the previous, connected action as your sample input. You can use the automatic mode editor to test multiple scenarios of this event, without actually running the action itself.
Interpret output results
The output you see is exactly what will be emitted as an event when the action is run in your story. Understanding this output helps you configure downstream actions correctly.
If the output is an object, you'll reference its fields in later actions using dot notation. If it's an array, you might need an explode mode action or a loop to process each item. If it's a single value, you can use it directly in formulas or action configurations.
Pay attention to data types too. Is that number actually a number, or is it a string? Is that array of objects structured the way your next action expects?
Extract code as a Run Script action
Once you've generated code that works perfectly, you might want to extract it as a standalone Run Script action. This is useful if you want to modify the code manually or reuse it in multiple places.
Click the Copy as Run Script button in the bottom right of the automatic mode editor. This creates a new Run Script action with your generated Python code, which you can then customize further if needed.