I think you can use the custom Render
<column name="product_id" class="SalesIgniter\Common\Ui\Component\Listing\Column\Product">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Product</item>
</item>
</argument>
</column>
You can manipulate value in class
namespace SalesIgniter\Common\Ui\Component\Listing\Column;
use Magento\Framework\Escaper;
use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Framework\View\Element\UiComponentFactory;
use Magento\Ui\Component\Listing\Columns\Column;
/**
* Shows product name in admin grids instead of product id
*/
class Product extends Column
{
/**
* Escaper
*
* @var \Magento\Framework\Escaper
*/
protected $escaper;
/**
* System store
*
* @var SystemStore
*/
protected $systemStore;
protected $productFactory;
/**
* Constructor
*
* @param ContextInterface $context
* @param UiComponentFactory $uiComponentFactory
* @param SystemStore $systemStore
* @param Escaper $escaper
* @param array $components
* @param array $data
*/
public function __construct(
ContextInterface $context,
UiComponentFactory $uiComponentFactory,
Escaper $escaper,
\Magento\Catalog\Model\ProductFactory $productFactory,
array $components = [],
array $data = []
) {
$this->productFactory = $productFactory;
$this->escaper = $escaper;
parent::__construct($context, $uiComponentFactory, $components, $data);
}
/**
* Prepare Data Source
*
* @param array $dataSource
* @return array
*/
public function prepareDataSource(array $dataSource)
{
if (isset($dataSource['data']['items'])) {
foreach ($dataSource['data']['items'] as & $item) {
$product = $this->productFactory->create()->load((int)$item[$this->getData('name')]);
$item[$this->getData('name')] = $product->getName();
}
}
return $dataSource;
}
}
source