title: Get data from referenced table in Sequelize and Node.Js
body: <p>I am taking sender_user_id and order_status as input from the user and displaying all fields in the order table corresponding to the given input. Now, I want to the product id from the order table to reference to the product_id in the products table and display the information related to the product. How can I do this?</p>
  <pre><code>const db =require('../../models')
  const Orders = db.orders
  const Products = db.products
  
  
  const orderDetails=async(req,res)=&gt;{
      
      try {
          const order = {
              //user_id: id,
              
              sender_user_id:req.body.sender_user_id,
              order_status:req.body.order_status
           
              
          };
     
      
          
  
          Orders.findAll({
             where:{
                 sender_user_id:req.body.sender_user_id,
                 order_status:req.body.order_status
  
             },
          })
          .then((order) =&gt; {
            if (!order) {
              return res.status(400).send({ 
                status:&quot;102&quot;, 
                message: &quot;order Not found.&quot; });
            }
            res.status(200).send({
              status:&quot;VB100&quot;,
              orders: order});
          })
          .catch((err) =&gt; {
            res.status(500).send({ message: err.message });
          });
      }catch (err) {
          console.error(err.message);
          res.json({
              status:&quot;102&quot;,
              msg: err.message
          })
      }
  
      };
  
  
  
  module.exports={orderDetails};
  </code></pre>