Below line is used to make field readonly in power app portal through js
$("#bdo_relationshiprole_name").parent().css("pointer-events","none");
Below line is used to set deault value in lookup field
$("#bdo_relationshiprole_name").attr("value",rolename);
$("#bdo_relationshiprole").attr("value",roleid);
$("#bdo_relationshiprole_entityname").attr("value","bdo_relationshiprole");
Below line is used to to used to get readonly value from field otherwise on form submit the read only values not getting
$("#bdo_relationshiprole").trigger('change');