protected function _findListValue(RepositoryInterface $table, string $listName, string $value) : string
    {
        $options = FieldUtility::getList(sprintf('%s.%s', $table->getAlias(), $listName), true);

        // check against list options values
        foreach ($options as $val => $params) {
            if ($val !== $value) {
                continue;
            }

            return $val;
        }

        // check against list options labels
        foreach ($options as $val => $params) {
            if ($params['label'] !== $value) {
                continue;
            }

            return $val;
        }

        return $value;
    }