Lookup filed match other field value

Lookup filed match other field value

Hi there,
I'm stuck with what I thought was a very simple task.
I've a string field (Field1) which is populated with a product code by an API.
In the same form I've a lookup to an Inventory form, where I've a list of products, with code, name, pic, exc.
I want that when a record is created or edited by the api, the value of Field1 is matched with the lookup field, which is set to display the product code, so that i can display all the product's data.

I've tried with the simple

lookup = input.Field1;

but doesn't work.

Any idea on how to do? 
thank you in advice