title: Loading custom attribute value in controller in Magento2
body: <p>I'm trying to load custom attribute value in my controller but it always returns null. Here is my code:</p>
  
  <pre><code>public function execute()
  {
      $product_id = $this-&gt;getRequest()-&gt;getParam('id');
  
      if(isset($product_id)){
  
          $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
  
          $_product = $objectManager-&gt;get('Magento\Catalog\Model\Product')-&gt;load($product_id);
  
          $colorGriding = $_product-&gt;getCustomAttribute('color_griding');  // returns null
  
          echo json_encode(array('message'=&gt;'found', 'colors' =&gt; $colorGriding-&gt;getValue()));
      }
      else
          echo json_encode(array('message'=&gt;'empty'));
  </code></pre>
  
  <p>What is wrong here?</p>