Answers.Body: <p>This is what I have:
  <a href="https://i.sstatic.net/akLpL.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/akLpL.png" alt="enter image description here"></a></p>
  
  <p>(I know you can read it :-)</p>
  
  <p>And in my code:</p>
  
  <pre><code>function civicrm_api3_note_Migrate($params) {
    // param migrate_type determines what will be selected, defaulted to contact
    $validTypes = array('contact', 'contribution', 'participant', 'relationship');
    if (!isset($params['migrate_type'])) {
      $entityTable = 'civicrm_contact';
    } else {
      if (in_array($params['migrate_type'], $validTypes)) {
        $entityTable = 'civicrm_'.$params['migrate_type'];
      } else {
        $entityTable = 'civicrm_contact';
      }
    }
  }
  </code></pre>
  
  <p>But I am not sure if that is what you mean?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-25T20:27:37.057Z
Answers.Text: Why does this work for you and not for me? Niet eerlijk!
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-26T01:06:02.813Z
Answers.Text: Ah - is working now! Perhaps I had my jobs mixed up; In any case - helemaal goed;
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-25T18:29:40.967Z
Answers.LastActivityDate: 2017-10-25T18:29:40.967Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>Looking for some help on getting $params to be passed on from the scheduled job -> GUI page -> into my scheduled job; so:</p>
  
  <pre><code>function civicrm_api3_job_ecocalculate($params) {
  </code></pre>
  
  <p>I'd like to be able to pass in e.g. </p>
  
  <p><a href="https://i.sstatic.net/cUC0F.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/cUC0F.png" alt="enter image description here"></a></p>
  
  <p>But when I try this I just get <code>$params = null</code> in my function; </p>
  
  <p>What am I missing? </p>
  
Tags: <extension><developer><scheduled-job>
Title: How can I get $params into my own scheduled job?
ThreadText: # How can I get $params into my own scheduled job?
  
  (Asked by: username_0 on 2017-10-25)
  
  Looking for some help on getting $params to be passed on from the scheduled job -> GUI page -> into my scheduled job; so:
  function civicrm_api3_job_ecocalculate($params) {
  
  I'd like to be able to pass in e.g. 
  
  But when I try this I just get $params = null in my function; 
  What am I missing?
  
  **Tags:** extension, developer, scheduled-job
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-10-25. Score: 2 | Accepted answer
  
  This is what I have:
  
  (I know you can read it :-)
  And in my code:
  function civicrm_api3_note_Migrate($params) {
    // param migrate_type determines what will be selected, defaulted to contact
    $validTypes = array('contact', 'contribution', 'participant', 'relationship');
    if (!isset($params['migrate_type'])) {
      $entityTable = 'civicrm_contact';
    } else {
      if (in_array($params['migrate_type'], $validTypes)) {
        $entityTable = 'civicrm_'.$params['migrate_type'];
      } else {
        $entityTable = 'civicrm_contact';
      }
    }
  }
  
  But I am not sure if that is what you mean?
  
  > **Comments:**
  > **username_0**: Why does this work for you and not for me? Niet eerlijk!  
  > **username_0**: Ah - is working now! Perhaps I had my jobs mixed up; In any case - helemaal goed;  
  
  ---
  
  