Fill field if another field is true

I’m trying to create a function for when the data of the field is only populated if parameters in another field are met.


In this example I want Full Name to only be populated if “referral” is true.
Currently keep getting “referral” field not found using:
if field(“referral”) == “true” then this end
and
if referral == true then this end

Any ideas what I should be doing instead?

See https://mockaroo.com/6bf5a670

Since referee a email depend on referral, referral needs to come before them in your list if fields.

Thank you! That makes sense, is there a simple way to make the Full Name not the same as the First and Last Name? As if they were a different person?

I can see the results of the solution but what did you do to get this to work?