Self referential Dataset

I can generate Schema 1: Company has fields “Company Name” without “Primary Contact” and then
I can generate Schema 2: Contacts has fields “Full Name” and “Company Name”

How can I then choose ANY of the Contacts with the same “Company Name” to be the Company “Primary Contact”

Or If I generate my Contacts first (with the hidden field for the “__Company Name” can I have more than one contact at the same company?

Thank you for looking.

Kindest Regards
Paul

1 Like

You could generate the Contacts data first (Full Name and Company Name), upload it back into Mockaroo, then in your Company schema pull in a contact for each company using a formula column with:

from_dataset('Contacts', 'Full Name', "Company Name" => field("Company Name"))

Thank you for that, however I’d like a random number of multiple contacts for companies.

I was thinking that maybe I generate say 200 company names, generate 1000 contacts using the 200 company names as a list, looked up randomly, then generate the Company using the 200 company names and use your dataset above to link a primary contact with the same company name? I presume this would work?

That sounds correct. Keep in mind that you could also upload the company names as dataset and then pull from it using the “Dataset Column” type when generating your Contacts.

Is there a way to upload accurate data to insert and use instead of the random data?
I know, this may sound odd, but it will help me and since Mockaroo is such a great tool I might as well just ask!