12 Replies Latest reply on Mar 31, 2016 12:47 PM by preddy-2 RSS
    preddy-2 Apprentice

    Problem in adding rows into infotable.

    Hello all,

    I am fetching data through REST API and trying to display that data in grid. REST transaction is successful and I could get the data.

    But, when I try to push the data into infotable, it is not successful.

     

    Testing the service will show only columns, doesn't show any rows. Below is the source code of the service.

    Any help is appreciated in this.

     

    With B/R,

    Praveen.B

     

     

    var restParams = {

      proxyScheme: undefined /* STRING */,

      headers: undefined /* JSON */,

      ignoreSSLErrors: undefined /* BOOLEAN */,

      useNTLM: undefined /* BOOLEAN */,

      workstation: undefined /* STRING */,

      useProxy: undefined /* BOOLEAN */,

      withCookies: undefined /* BOOLEAN */,

      proxyHost: undefined /* STRING */,

      url: "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20rss%20where%20url='http://rss.people.com/web/people/rss/topheadlines/index.xml'%20limit%203&format=json" /* STRING */,

      content: undefined /* JSON */,

      timeout: undefined /* NUMBER */,

      proxyPort: undefined /* INTEGER */,

      password: undefined /* STRING */,

      domain: undefined /* STRING */,

      username: undefined /* STRING */

    };

     

     

    // result: JSON

    var jsonResult = Resources["ContentLoaderFunctions"].PostJSON(restParams);

    var myItems= jsonResult["query"].results.item;

     

    var Infoparams = {

      infoTableName : "InfoTable",

      dataShapeName : "RestExample"

    };

     

    // CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(RestExample)

    var MyInfoTable = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(Infoparams);

     

     

    function ProcessElements(element, index, array)

    {

        var row = new Object();

        row.author = element.author;

        row.category = element.category;

       

        MyInfoTable.AddRow(row);

    }

     

    myItems.forEach( ProcessElements);

     

    var result = MyInfoTable