Open different form for different list view in single form for using 'List or Library' control

Hello @harshp924,

You can use the code below to open the corresponding form set from List or Library control.

Please add this code to JavaScript Editor >> Current Form section in the parent form:

function selectFormSet(dt, formSetId) {
    var funcName = dt._listViewManager.openDialogFuncName;
    var func = window[funcName];
    window[funcName] = function(url, pageType) {
        window.FormSet = formSetId;
        func(url, pageType);
    }
}
fd.spRendered(function() {
    fd.control('SPDataTable1').ready().then(function(dt) {
        //replace with the Forms Set ID for view 1
        selectFormSet(dt, 'df788428-cab9-41f4-8583-4ab8b41e0a28');
    });
    fd.control('SPDataTable2').ready().then(function(dt) {
         //replace with the Forms Set ID for view 2
        selectFormSet(dt, '27f0b45a-f904-42d4-b28e-f37d581e36f6');
    });
});

Please add this code to the JavaScript Editor >> Custom Routing section in the child form:

if(window.parent.FormSet){
    return window.parent.FormSet;
}