Push/Add asset to Entry by asset filename
You need to fetch the asset and set it as a field value to your entry

$pushImageId = Asset::find()-&gt;filename($name[0])-&gt;ids();


id will display the id property of your query. You won't fetch any results with it ids() will return an array of asset ids

$product-&gt;setFieldValue ('productImages', $productImages);


Will set the relation and finally you can store the element

Edit: and you need to fetch the product as well. Currently you just create the query for it