Iguana Concepts

Using Sample Data

Iguana allows you to use sample data in the Translator editor, to mimic how a script will run within a channel. This is extremely useful during development and testing as you can see exactly how your script will behave with live messages. Sample data can be created in several ways: Loaded from files or the logs, created manually, or included when you import a project.

Sample data is passed to the main function using the Data parameter, main(Data), in exactly the same way that a script will receive live messages:

Screen Shot 2014-06-05 at 10.07.04

Sample data is managed through the Sample Data screen, which is accessed by clicking the Sample Data link in the script editor toolbar:

Screen Shot 2014-06-04 at 16.01.31

Tip: Something is wrong I cannot load sample data into my From Translator script!

Actually this is by design. Remember that sample data shows you how your script will behave with live messages. And that sample data is passed through the main Data parameter in exactly the same way as live data.

The From Translator is an exception as it only retrieves data using code, and never receives input through the Data parameter. Therefore to mimic how a live script runs it must never receive input through the Data parameter. This means a From Translator cannot use sample data.

Note: If we did allow sample data, then you could write From Translator code (using the Data parameter) that would work in the editor but fail when you run the channel.

For More Information