How to auto populate reference fields?

As I understand that wix doesn’t have the capability to achieve this yet. So how do I achieve this by coding? An example will help. Thanks.