Generators in Fake Data
Generators are core components of Fake Data's functionality. These are the functions that are used to generate the actual data that is being inserted in form inputs.
If you are going to customise the data that is generated by the extension, then this is where you would want to start.
When first installed, Fake Data comes with 20 default generators:
|Default generators||Sample output|
|Full Name||Delores Runte|
|[email protected] *|
|Job Title||Direct Program Supervisor|
|Company||Watsica - Cronin|
|Address||54998 Kacey Dale|
|Words||placeat eos voluptatem|
|Sentence||Dolorem fugit eos.|
|Paragraph||Vero debitis voluptas vel at et perspiciatis quae ipsam. Commodi dolor est.|
|Text||Eum vero et deleniti. Fugit unde provident voluptatem aliquid est. Numquam sit excepturi aperiam[...]|
|Date & time||2021-08-07 04:34:45|
Overriding a Default Generator
Default generators cannot be renamed and cannot be deleted. You can however, overwrite them by clicking on the dropdown menu that is on their right side and choose the
Custom Code option:
If the generators that come predefined with Fake Data are not enough, you can always create more custom generators.
In order to create a new Custom Generator, open Fake Data's options page, go to Generators -> Custom Generators -> and click on the button that can be found on the right side.
Nesting Custom Generators
When you create Custom Generators and give them a name, you can put the
/ character in order to have them nested inside the context menu.
For example, let's say you have the following 3 custom generators created:
Cryptocurrencies/Random Bitcoin Address
Cryptocurrencies/Random Ethereum Address
Cryptocurrencies/Random Litecoin Address
Then, when you right-click on a form element and go to Fake Data submenu, they will show up like this:
Reordering Custom Generators
If you have multiple custom generators and want to organize them better, you can reorder them by dragging the top part of their container.
Make sure to save the changes when finished.