
Similarly, you can use different logical operators, functions, Regular Expressions to do data transformations. Please see the above image for the concat function. The Mockaroo API doc has all the syntax for different functions. We used concat function to concatenate all these strings. The Address field in our requirement is a combination of Street, Province, and Postal code. Using formulas you can do things like writing different functions for date diff, concatenate strings, mathematical calculations, conditional logic etc…, Any kind of data transformation is made simple using these formulas. It helps to reference existing fields and generate data based on the custom code. You can use formulas to create your own data types in Mockaroo. Formulaįormula is a powerful feature of Mockaroo to generate any kind of data we want. For our requirement, we choose Custom List values for the field ‘Area calculation mode’ to generate random data values ‘radius’ or ‘travel-mode’ for each row. It picks items randomly or sequentially from a custom list of values specified. Custom ListĬustom List is another data type which is appropriate for populating default values in the fields. This helped us to create this data quickly and made our job simple. Mockaroo supports a data type called Longitude and Latitude which allows us to generate data for longitude and latitude values for the given location details. Generating realistic data for Longitude and Latitude fields in our data set was a time-consuming process. Here is link to location_details Schema which we created for our data creation (See Mockaroo- Location_details Schema image) Longitude and Latitude Data types


In this section, I’ll talk about the ones I found most useful features like Formulas, Functions, Custom List which we have applied for data transformations specific for our requirement. Mockaroo API doc pageĭifferent operations using Mockaroo Data Types You can also customize the data types according to your data needs. You can view the list of 74 types on the API docs page as shown below. Mockaroo supports around 74 different types, each of these data type provides a range of appropriate sample data that is used to populate the field. You can add more fields by clicking on the “Add another field” button. The column named ‘Field Name’ accepts simple text input, ‘Type’ accepts data type and ‘Options’ accepts numerical input. You can move fields up using the handle bars on the left, or delete fields using the cross on the right. You simply enter a field name and select a data type. The tool has columns for data field names, their data types and blank options which you can alter to adjust the data order and specifications. It generates data from a saved schema which can be helpful for automated testing. It provides a GUI to build some data that suits your needs and lets you generate up to 1,000 rows of realistic test data in CSV, JSON, SQL, and Excel formats. Mockaroo is a brilliant online tool that lets you solve the data generation problems in a few clicks.
FAKE DATA GENERATOR EXCEL MANUAL
As you can guess, a lot of manual effort was needed for populating this kind of test data.

The fields ‘travel mode’ and ‘radius’ correspond with the field ‘area calculation mode’. If the area calculation mode was set to ‘travel-time’, we had to set ‘travel mode’ to one of “Bike”, “Walk”, or “Drive” and then we had to set the value of ‘travel-time’ to a number of minutes around the location. If area calculation mode is ‘radius’ then we had to set the ‘radius’ parameter to be a radius in miles. Area calculation mode has two dependent parameters ‘radius’ and ‘travel-time’. The Address field is a combination of Street, Province, and Postal Code. Longitude and Latitude attributes are based on the location details. We had fields like Longitude, Latitude, Address, Area calculation mode, Radius, Travel mode, Travel type. Our requirement was a bit more complex than just using random names or address. This post is about how I could use different features of Mockaroo which I felt would be very helpful for anyone testing data intensive applications. I found it really helpful and it fit my needs very well. Mockaroo is an excellent tool for generating realistic test data.

Recently when I was searching for some tools for data gathering I chanced upon a tool called Mockaroo. The data creation involved multiple steps like downloading some data from the net, removing some columns, transforming it as per needs using Python code. At a recent client engagement, my colleague had to create some location data for testing one of the client application.
