Skip to main content

Best Practices

Use Notes

Every Action Batch includes a Note field — use it to briefly describe what the batch is responsible for.
This becomes especially valuable when dealing with nested batches, helping you identify each block's purpose and improving long-term maintainability.

Sent Fields

  • Use descriptive names
    Name your Sent Fields in a way that reflects their purpose (e.g., userId, selectedState) for clarity and traceability.

  • Only pass what you need
    Avoid overloading batches with unused fields — this keeps logic clean and easier to follow.

  • Validate data availability
    Make sure any referenced widget values, data fields, or external sources are loaded and accessible at runtime.

Keep Batches Modular

  • Break up complex logic
    If an Action Batch includes more than ~5 actions or multiple nested layers, consider splitting it into smaller, focused batches.
    Example: grouping the reset logic for 10 widgets into its own reusable batch.

Use Evaluations Wisely

  • Stick to simple conditions when possible
    Custom functions add power but also complexity. Favor standard Evaluation Types unless you need highly custom logic.

  • Nest logically
    Use nested evaluations to layer decision-making. This makes each step easier to debug and modify.

Optimize for Performance

  • Avoid deep nesting unless necessary
    Deeply nested batches are harder to debug and may slow down execution, especially on resource-constrained devices.

  • Apply delays with intent
    Only use delays when there's a clear need — excessive delay usage can lead to timing issues or unwanted visual artifacts.

  • Filter early, process less
    When using large datasets, apply Filtered Data Source logic early to reduce the workload for downstream actions.

Debugging Tips

  • Test logic in stages
    Build and validate each batch layer separately. Use temporary tools like Log Received Data actions to inspect values during execution.

  • Guard against undefined values
    Many issues stem from missing or undefined data. Use Is Empty or Is Not Empty evaluations to catch and handle those cases reliably.