How to fetch the value ot variable name of the field which is inside Dialog Box,

Hai Folks I have a dialog box with 2 fields,

According to first field,second field selection list Should come,

Now i want to fetch the variable name of the second field ,

In report we use the below line,
var expected_delivery_date = frappe.query_report_filters_by_name.expected_delivery_date;

How to fetch the value ot variable name of the field which is inside Dialog Box,

Code i have tried,

Js:

`frappe.ui.form.on("Sales Order", "update_all_items", function(frm, cdt, cdn) {

console.log(“NEwly created button has been clicked”);
var selected_field = “”;
var d = new frappe.ui.Dialog({

‘fields’: [{
“fieldname”: “selected_field”,
“fieldtype”: “Select”,
“label”: “Select the field which you want to update!!”,
“options”: [“Reqd By Date”, “Warehouse”,“Project”],
onchange: function(e) {
console.log("Onchange ", this.value);
frappe.call({
method:“nhance.api.getDataList”,
args: {
“docName”:this.value ,
},
async: false,
callback: function(r)
{
var expected_delivery_date = frappe.query_report_filters_by_name.expected_delivery_date;
expected_delivery_date.df.options = r.message;
expected_delivery_date.df.default = “”;
expected_delivery_date.refresh();
expected_delivery_date.set_input(expected_delivery_date.df.default);

	}//end of call back fun..
	});//end of frappe call..


	}
		
        },

        {
            "fieldname": "expected_delivery_date",
            "fieldtype": "Select",
            "label": "Expected Delivery Date"		
       }
    ]

});
d.show();
var values = d.get_values();
console.log(“checking from outside******”+ values.selected_field);

});
///"nhance.api.getPoData
`