Connecting form fields input to Dataset

Isn’t there a way via code to get a field content from a Collection and set it into a form field value?