Generate Spouses name

I have a field ‘Marital Status’ (Single,Married etc.), I’d like to create a new field called spouse which if married 90% of the time generates a first name for the opposite’Gender’ and 10% the same Gender.

Example: Bob Smith, would generate Sarah Smith (90% of the time) else Fred Smith

I couldn’t event get the following to work so need help getting to the above.

I tried i.e.: if (Gender == ‘Male’ then field("__FirstNameF"))

Thank you for looking at this.

You can use the random function to execute specific logic with a given probability. Here’s an example that generates same-gender spouses 10% of the time: