Conditionally generate related records in a schema based on the value of a field within a Dataset

Hi All,

I have only today stumbled across Mockaroo so apologies if this is something simple that I am overlooking.

I have a contract.start_date in my “Contract” schema which I have loaded back in as a Dataset.
Then I have a second schema “Account” where I need to generate a Account.established_date that is always greater than the Contract.start_date.
I manage to accomplish this with:

date(from_dataset("Contract", "start_date", company_id: company_id),"%dd/%mm/%yyyy") + days(random(1,5))

However it does not seem to inherit the date format mask of dd/mm/yyyy from either the Dataset field or from the date() function in the expression and instead is presented as yyyy/mm/dd hh:mm:ss.

The hurdle I am facing now is how can I only create records in my Account schema based on a Contract.status field?
What I am after is to only generate records in my Account schema for Contract.id’s where the Contract.status = “Accepted”.

Link to my Contract schema: https://mockaroo.com/187f6600
Appreciate any help you can offer to steer me in the right direction.

thanks,
Taylor