Basing a custom list on what was chosen in another custom list

I have two custom lists. Based on what is randomly chosen from the first list I want to pick the same item from the second list. For example, first list is Priority Mail, UPS Standard Delivery and second list is USPS,UPS

Both are set to be empty 50% of the time.

So, if Mockaroo chooses Priority Mail for an field, I need the second field to say USPS

I tried
if class == 'Priority Mail' then 'USPS' elsif class == 'UPS Standard Delivery' then 'UPS' end

But it fails with a syntax error.

You can accomplish this by using Random and Custom for your Option on each Custom List. Check out the example schema:

1 Like

I would set a hidden field called something like ‘__postage_index’, type of number and min of 0 and max one less than possible values (your example has two values, so 1)

Then class and carrier would be formula type, with class [‘Priority Mail’, UPS Standard Delivery’][__postage_index] and carrier [‘USPS’,‘UPS’][__postage_index]

This has the effect of creating a random index and using the same index to access both arrays.

Example here: https://mockaroo.com/1720c5d0

1 Like