Link field filters with 2 different field

In Instructor Doctype, there are two fields (madrasa_1 and madrasa_2) linked to Branch. In the student form, there is just one field named Branch.

Trigger field “instructor”

I’m trying to filter. If madrasa_1 does not equal “branch”, try madrasa_2 or filter with these two fields.

if its not possible i create table in instrutor doctype? Please help
Thanks in advance

Capture

frappe.ui.form.on(“Student”, {
setup: function(frm) {
frm.set_query(“instructorr”, function() {
return {
filters: [
[“Instructor”,“branch”, “in”, [“madrasa_1”, “madrasa_2”]]
]
}
});
}
});