I have created a custom Multiselect product attribute. It has been created successfully but the value are saved when assigned store view specific.

But if i select an option and save in global it is not saving.Anything else i am missing?

Step1: setup file InstallData.php

```
namespace Vendor\Module\Setup;

use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;

class InstallData implements InstallDataInterface
{
/**
 * @var \Magento\Eav\Setup\EavSetupFactory
 */
private $eavSetupFactory;

/**
 * Constructor
 *
 * @param \Magento\Eav\Setup\EavSetupFactory $eavSetupFactory
 */
    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
    }

    public function install(ModuleDataSetupInterface $setup,  ModuleContextInterface $context)
    {

       $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
       $eavSetup->addAttribute(
           \Magento\Catalog\Model\Product::ENTITY,
           'attr_code',
           [
              'type' => 'text',
              'label' => 'Attr Label',
              'input' => 'multiselect',
              'sort_order' => 2,
              'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend',
              'source' => 'Vendor\Module\Model\Config\Source\Options',
              'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
              'visible' => true,
              'required' => false,
              'user_defined' => false,
              'filterable' => true,
              'used_in_product_listing' => true,
          ]
      );
   }
}

```

Step2: Source Model

```
namespace Vendor\Module\Model\Config\Source;

class Options extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
{

   public function getAllOptions()
   {
       $this->_options = [
            ['label' => __('Label1'), 'value'=>'0'],
            ['label' => __('Label2'), 'value'=>'1'],
        ];
        return $this->_options;
   }

   public function toOptionArray()
   {
       $arr = $this->getAllOptions();
       $_options = [];
       foreach ($arr as $key => $value) {
          $_options[] = [
              'value' => $key,
              'label' => $value
          ];
       }

      return $_options;
   }
}

```