working with two reference fields taken from tow different collections and then add those two reference fields other dataset.

i have three datasets and then i am creating a reference fields in one dataset how to submit the form . please give me any advises or send me any examples .
Thank you…

above description design part