4 Replies Latest reply on Apr 3, 2016 5:41 AM by carlesc RSS
    jjuran Newbie

    Adding rows to an infotable

    Hey there,

     

    In the Thingworx scripts, how can you add a row to an infotable that is already existing? Is see there is an AddRow option and I try to add that to my me.thisInfo object, but it requires a "row" object as an argument and I do not know how to set that opject up. I tried a few ways and it accepted it but with no addition to the Infotable.

     

    Within the infotable the data shape just has the field definition of "Names" Just to keep it simple for now.

     

    Thanks for any help!

      • Re: Adding rows to an infotable
        carlesc Ninja

        For what you say, should be that easy:

         

        me.thisInfo.AddRow({ Names: "whatever Name"});

         

        But for the record, in order to Add Row to a Property Infotable, better you Clone Infotable, modify it and then set it again the property:

        1. var clonedData = Resources["InfotableFunctions"].Clone( { t1: me.thisInfo });
        2. clonedData.AddRow({ Names: "whatever Name" });
        3. me.thisInfo = clonedData;