Question about field relations and random values

I’ve been using Mockaroo for a little while now and I’ve managed to get whatever data I need until now. This is my issue.

I have 2 fields the first one can be blank or have 1 of 3 values, the second one depends on 1 in terms that if field1 has data, field2 has to have data (field 2 can have values also from a set of values) so table should look something like

| field 1 | field 2 |
|||
| value A | Value X |
|||
|||
| value A | Value Z |
| value B |Value X |
|||

So there’s really no relation on what the values are in field 2 to the values on field 1 but I do need to make it so if fiel1 is empty, make field2 empty, if there’s a value in field1, populate field2 with something

I tried to use formula, to do something like

if field.nil? then nil else /“value1”|“value2”|“value3”/ end

but it seems that the formula field type doesn’t like regexes

when I use the regex within it I get

(?-mix:("A"|"B"))

Using

from_dataset(“dataset”, “column”, join_criteria)

didn’t work for me since there’s no relations to make between the fields

Solved it myself

picked the regex field type for field2

then used (ValueA|Value B|Value C) in it

then used this formula

if field1.nil? then nil else this end

easy enough