title: How to run a GET and a POST request from pre request tab of another request in postman?
body: <p>I am in a situation where I need to run a request (lets say request C) based on the responses of request A and B. Here A is a GET &amp; B is a POST request. Now I have tried to use pm.sendRequest twice in pre-request tab of C. But the problem I am facing mainly is, B is running ahead of A all the time. That means POST is running before GET. As a result I am unable to successfully run request C.</p>
  <p>Here is a sample of my pre request script:</p>
  <pre><code>const getOTP = {
    method: 'GET',
    url: `${pm.environment.get('base_url')}/${pm.environment.get('common_path')}/otp-login?msisdn=${pm.environment.get('msisdnWhite')}`,
    header: {
        'User-Agent': 'something..',
        'Accept-Language' : 'en'
    },
    
  };
  setTimeout(15000)
  
  const postOTP={
      method : 'POST',
      url : `${pm.environment.get('base_url')}/${pm.environment.get('common_path')}/otp-login`,
      header: {
          'Content-Type':'application/json',
          'Accept-Language':'en'
      },
      body:{
          mode : 'application/json',
          raw: JSON.stringify(
              {
                 &quot;msisdn&quot;:&quot;123456789&quot;,
                  &quot;otp&quot;:&quot;0000&quot;
                  } )
      }
  };
  
  
   pm.sendRequest(getOTP, (err, response) =&gt; {
    const jsonResponse = response.json();
    pm.environment.set(&quot;GETOTP&quot;,jsonResponse.result)
    console.log(jsonResponse);
   });
  
   pm.sendRequest(postOTP, (err, response) =&gt; {
    const jsonData = response.json();
        pm.environment.set(&quot;access_token&quot;,jsonData.access_token)
  });
  </code></pre>