Functions syncing issue

so I have an app and I want to gather information from different doctypes and aggregate all to one form.
I have an issue with functions synchronization:

frappe.db.get_list('First DocType',{
 filters:{
  'field_one': 'text'
 },
 fields:['feild_two']
 }).then(records => {
   frm.set_value(record, records.feild_two);
 };
frappe.db.get_list('Second DocType',{
 filters:{
  'field_three': 'text2'
 },
 fields:['feild_four']
 }).then(records => {
   frm.set_value(record_2, records.feild_four);
 };
...
etc.

You get the point…
The thing is, I don’t get all I need in one go.
Sometimes I receive everything right, but sometimes I don’t get all the information.
So as I understand it, it’s because of functions not waiting for each other to end.
Is there a way to fix this, without resulting to python scripts with white lists and all of these?
I really hate to start massing with over convoluted JSON responses…

Reference:

Not sure you understand my problem.
I can get anything I need from any doctype I need, however, if I click a button which aggregates data from multiple doctypes there is probably some sync issues, causing my data to be partial sometimes, and sometimes complete.

I understand your problem. I tested it by retrieving data from multiple doctypes and setting the values, but I did not encounter any issues.

You can also use like:

frappe.db.get_value("DocType 1", {"name": field_1}, "doc1_field", function(value1) {
    frm.set_value('current_doc_field_1', value1.doc1_field);
});

frappe.db.get_value("DocType 2", {"name": field_2}, "doc2_field", function(value2) {
    frm.set_value('current_doc_field_2', value2.doc2_field);
});