.. include:: ../../toolkit-substitutions

.. oe:namespace:: OESaiph

.. meta::
   :keywords: OERecordToMol

.. oe:function:: OERecordToMol

   .. attention::

      |PRELIMINARY-API|

   .. oe:language:: c++ java csharp

      .. oe:api::

         void OERecordToMol(OEDataFlow::OERecord& rec, OEChem::OEMolBase& mol,
                            bool strict = false, bool fallback = false)

   .. oe:language:: python

      .. oe:api:: python

         OERecordToMol(rec: OERecord, mol: Union[OEGraphMol,OEMol,OEQMol],
                       strict: bool = False, fallback: bool = False) -> None

   Takes an existing :ref:`OERecord <OEDataFlow_OERecord>` object (rec) and generates a new
   :ref:`OEMolBase <OEChem_OEMolBase>` object (mol) with the data provided in the
   :ref:`OERecord <OEDataFlow_OERecord>` as data set to the OEMolBase. If `strict`
   is set to true, then an error will be thrown instead of a warning when data
   cannot be set to the :ref:`OEMolBase <OEChem_OEMolBase>`. When `fallback` is set true,
   the function will check the :ref:`OERecord <OEDataFlow_OERecord>` for any
   :ref:`OEMol <OEChem_OEMol>` object if no specific :ref:`OEMol <OEChem_OEMol>` 
   :ref:`OEField <OEDataFlow_OEField>` named *Molecule* is found.
