I have tried to load collection in custom grid Based on current product data
<?php
$redirectUrl = $this->helper->getCurrentProduct();
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$request = $objectManager->get('Magento\Framework\App\Request\Http');
$param = $request->getParams();
$productId = $param['current_id'];
$product = $this->helper->getLoadProduct($productId);
$sku = $product->getSku();
$TestData = $product->getTestData();
$TestDatasarr = explode("|", $TestData);
$TestDatavalues = "'" . implode("', '", $TestDatasarr) . "'";
$this->getSelect()->orwhere("main_table.testdatas IN($TestDatavalues)");
In the above code i got $TestDatavalues
like 'test','test1','test2'
when I pass the values manually in getslect in like $this->getSelect()->orwhere("main_table.testdatas IN('test','test1','test2')");
It shows the collection data but when I pass the variable it shows empty data $this->getSelect()->orwhere("main_table.testdatas IN($TestDatavalues)");
when i print it shows the empty
Can anyone help on this.