How do I map a certain ID with a name?

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…

EDIT : Sorry, I’m a douche! Turns out I was using ‘elseif’ instead of ‘elsif’ AND I wasn’t using ‘end’ at the end of the conditional!

Lol, I think elsif is the #1 problem new Mockaroo users have with formulas. Half considering a find/replace of elseif to elsif before processing the formula :slight_smile: