IT Process Automation

  • 1.  I am trying to load a table in a form

    Posted Dec 03, 2015 09:05 AM

    Because of the way that Value Maps are now displayed (not in table form), I would like to create a process that can be easily used to edit the value in a dataset value map.  I want to pull in the data that currently exists in the dataset and populate a table (number of rows would be dependent on the number of indexed values in the array (some of which may be NULL/blank).  Number of columns is constant as it is equal to the number of parameters in the value map.  After the values are populated in the table I would like to bring back the form values from the table and repopulate the value map values.  Once the value map is updated it will be moved back over to the dataset in one "move".

     

    My thought was to use the Form Initialization code to build the data for the table.  I know I can set a single field with Form.Var_0 = Process.Var_0. I tried setting the values of a column similar to an array Form.Table_0[0].Var_0 = ... and Form.Table_0.Var_0[0] = ...

     

    There is no information on how to use the ca_pam_setTableData or the ca_pam_setTableDataFromJSObject.  I haven't dealt a lot with the form functions so any help pointing me in the right direction would be helpful. 

     

    Thanks,

    Paul Walker



  • 2.  Re: I am trying to load a table in a form
    Best Answer

    Posted Dec 03, 2015 09:42 AM

    Hello Paul,

     

    I have a similar workflow where I do what you are describing. I've done this by using the following code in the Form Initialization Code.

     

    // Temporary array to hold values being passed to form.

    var arr = [];

     

    // Iterates through an array and places values into a value map

    for ( var i = 0; i < Process.resourceArr.length; i++) {

      var rea = newValueMap();

     

      rea.resource = Process.resourceArr[i];

      rea.description = Process.descriptionArr[i];

     

      arr.push(rea);

    }

     

    // Assigns the temporary array to the table element and populates

    Form.resourceMatrix = arr;

     

    Hopefully this helps

     

    Brian