Quantcast
Channel: Mockaroo Community Forum - Latest posts
Viewing all articles
Browse latest Browse all 2665

How do I map a certain ID with a name?

$
0
0

I've just started using Mockaroo, and boy, is it amazing! Kudos to the dev!

I'm not really good with Ruby, so I still haven't gotten my head wrapped around the syntax as of now. My question is pretty simple - I want to generate data with the following fields:
1 - customer_id (number from 1 to 100)
2 - name (first name)
3 - email (email)
4 - drug name (drug name)

My customer_id should be mapped to the other fields. That, and there HAVE to be at least X number of entries for a specific customer_id in the data set.

For e.g., customer_id 1 can buy multiple drugs.

How do I maintain the mapping?

I tried the following in the 'name' field : if customer_id == someNumber then 'someName', but it's giving me a syntax error...


Viewing all articles
Browse latest Browse all 2665

Trending Articles