Mock Credit Card Data
I don’t believe it is possible to tell if a given number is in service or not without contact the credit card company. Mockaroo simply generates numbers that are valid according for the formulas...
View ArticleUnrelated String to Integer conversion error
When you generate a single record, a ruby Hash is returned. When you generate multiple records an array of hashes is returned. So you probably want something like: data.each {|record|...
View ArticleDate format changes when using formula
You need to return a Hash with key "$date". For example: { "$date" => this + hours(12) }
View ArticleHow to generate random subset from the customlist
When generating JSON data, you can simple add "[n]" to the name of any field to generate an array of values. For example, "labels[3]" will generate 3 randomly selected values in an array. See...
View ArticleHow to generate data: [12, 19, 3, 5, 2, 3]
If you're using JSON, just choose the Number type and name your field something like "numbers[6]" to generate an array of 6 numbers. See "Arrays" here: http://mockaroo.com/help/json
View ArticleUnrelated String to Integer conversion error
Thanks, I updated my script to: schema "Content Item" record = generate 9 record.each {|record| record['category'] = params['category']} record And that worked perfectly.
View ArticleCity between 3 fixed values
Hi there, What i'm trying to do is make sure my city is only one of tree values : Antwerp, Hasselt or Gent. I tried many things but i just can't seem to get it
View ArticleFormulas on random fields
OK, is there a mockaroo/ruby function to identify if a particular sub-string was generated in a field created via regular expression?
View ArticleFormulas on random fields
For a simple substring you can use: my_field.include?("foo") or to use a regex: my_field.match(/foo/)
View ArticleCity between 3 fixed values
Yeah, you would need to use a custom list. Mockaroo only allows you to specify down to a state/province, not a city.
View ArticleAdding a timestamp with ISO 8601 and HTTP/1.1 500 Internal Server Error when...
Can 'timestamp' be added as one of the official types? There are Time and Date options, but Timestamp is a combination of both!
View ArticleGenerate number of array values based on value of another field
What is the best way to accomplish this? If Field1 = "ABC" then Field2[1]If Field1 = "EFC then Field[2] Thanks for your help!
View ArticleAccess-Control-Allow-Headers Error
I am getting the following error when attempting to do a POST. Failed to load https://my.api.mockaroo.com/emailforms.json?key=********&__method=POST: Request header field Content-Type is not...
View ArticlePersisting Data
Make sure to press the save button before performing any other functions? Not sure if that's what you're looking for.
View ArticleWhat is the expected result for the inline formula on a Repeating element?
I am trying to customize the way that the number of details in my schema is being determined. Instead of using a Repeating Element with a random number of instances between a minimum and maximum...
View ArticleAccess-Control-Allow-Headers Error
I found a solution to my error. This is related to CORS. (https://github.com/axios/axios/issues/191#issuecomment-311069164) For me, a simple, temporary fix until we move to our own API is to use...
View ArticleAccess-Control-Allow-Headers Error
Thank you for posting this. I think I ran into the same issues when testing against the latest version of jQuery. It should be fixed now. Mockaroo will now return the value of the...
View Article