Magento2 How to query value in catalog_eav_attribute?

I’ve added a new value in catalog_eav_attribute, similar to Use for Promo Rule Conditions or Used in Product Listing. How do I call that property of the attribute in a phtml view template?

For example it’s called my_custom_field and I want to test for it to be true or false, like:

    <div class="additional-attributes-wrapper table-wrapper">         <table class="data table additional-attributes" id="product-attribute--specs-table">             <caption class="table-caption"><?= /* @escapeNotVerified */ __('More Information') ?></caption>             <tbody>             <?php foreach ($  _additional as $  _data): ?>                 <?php if($  _data['my_custom_field']): ?>  //this code is where I need to check if the attribute's property is true or false                     <tr>                         <th class="col label" scope="row"><?= $  block->escapeHtml(__($  _data['label'])) ?></th>                         <td class="col data" data-th="<?= $  block->escapeHtml(__($  _data['label'])) ?>">                           <?php echo  /* @escapeNotVerified */ $  _helper->productAttribute($  _product, $  _data['value'], $  _data['code']);?>                         </td>                     </tr>                 <?php endif;?>             <?php endforeach; ?>             </tbody>         </table>     </div> <?php endif;?> 

I get an error of “Error filtering template: Notice: Undefined index: my_custom_field” when the template is called.

This is how I created the attribute property: Magento 2 Load database value to custom field in product attribute