In this  Blog we can see how to  auto populate a lookup field value using another lookup field value in power apps.

Login to Power Apps portal using “Make.powerapps.com”

In PowerApps navigate to solutions.

In the Solution select that u have created Solution.

Create a web resource using the below Code

function LookupValue(executionContext){
var formContext=executionContext.getFormContext();
var crmonce=formContext.getAttribute(“crmonce_lookup1”);
if (crmonce != null) {
var lookup=crmonce.getValue();
if ((lookup != null)) {
if (lookup[0].id != null) {
var test = new Array();
test[0]=new Object();
test[0].id=lookup[0].id;
test[0].name=lookup[0].name;
test[0].entityType=lookup[0].entityType;
formContext.getAttribute(“crmonce_lookp5”).setValue(test);
}
}
}
}

Add web resource to form library in the form.

Navigate to the tables in navigation menu select the developer tables And select the Main form .

Open Form libraries and Click on Events and added Handlers Name as shown in below.

 

In Event Handler we need select the onChange events.

 

We need to Save and publish the customizations in the Form 

After that open the main form and refresh form we can see the same another lookup also