I have grid in which i try to filter a field name "seller_id" and this grid is a coming from a custom dataprovider with join of two tables.

Now the issue is these both table have same column name "seller_id" due to which it throws ambiguous column error upon filtering the column "seller_id".

2 Answers 2


Make use of select and alias in join might resolve your issue

  • already have alias but when i filter them it shows error
    – Asad Ullah
    Commented Sep 19, 2022 at 7:39
  • Share your code Commented Sep 19, 2022 at 7:58
  • shared my answer, thanks for the help its resolved
    – Asad Ullah
    Commented Sep 19, 2022 at 8:37

write this function in dataprovider file

 * @param \Magento\Framework\Api\Filter $filter
public function addFilter(\Magento\Framework\Api\Filter $filter)
    if($filter->getField() === 'seller_id') {
    $joinRefField = "main_table.".$filter->getField();
    if (isset($this->addFilterStrategies[$filter->getField()])) {
                [$filter->getConditionType() => $filter->getValue()]

    } else {

as you were getting column name in " $filter->getField() " so you need to modify where query using the first if condition

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.