title: How to increment number in function parameter as we drag the cells
body: <p>I had a custom function (find below) that parse jason data to googlesheets. Using function I am retrieving values using following parameters. </p>
  
  <pre><code>=IMPORTJSON("https://mirko.com/api/v3/financials/income-statement/"&amp;C4&amp;"","financials/0/date")
  </code></pre>
  
  <p>I want the values in "financials/0/date" to increment like this 1,2,3,.....x. How could I possibly do it. </p>
  
  <pre><code>/**
  * Imports JSON data to your spreadsheet Ex: IMPORTJSON("http://myapisite.com","city/population")
  * @param url URL of your JSON data as string
  * @param xpath simplified xpath as string
  * @customfunction
  */
  function IMPORTJSON(url,xpath){
  
    try{
      // /rates/EUR
      var res = UrlFetchApp.fetch(url);
      var content = res.getContentText();
      var json = JSON.parse(content);
  
      var patharray = xpath.split("/");
      //Logger.log(patharray);
  
      for(var i=0;i&lt;patharray.length;i++){
        json = json[patharray[i]];
      }
  
      //Logger.log(typeof(json));
  
      if(typeof(json) === "undefined"){
        return "Node Not Available";
      } else if(typeof(json) === "object"){
        var tempArr = [];
  
        for(var obj in json){
          tempArr.push([obj,json[obj]]);
        }
        return tempArr;
      } else if(typeof(json) !== "object") {
        return json;
      }
    }
    catch(err){
        return "Error getting data";  
    }
  
  }
  </code></pre>