title: SNMP4j agent snmp table
body: <p>I have created on SNMP agent using snmp4j api but getting issue with snmp table registration</p>
  
  <p>Once i register a table and and rows in table. and after that if i set the values in table all the rows got set with same value.
  I have snmp table created from JSON </p>
  
  <p>In below table if i set value </p>
  
  <p>.1.3.6.1.4.1.1.201.6.2. it set the values for all the rows that are registered in below table. Does anyone aware of how to register and set the values properly using snmmpj agent.</p>
  
  <pre><code>{
          "tableName": "table1", 
          "tableId": ".1.3.6.1.4.1.1.201.6.1", 
          "columns": [
              {
                  "columnName": "column1", 
                  "columnOID": 1, 
                  "dataType": 70, 
                  "accessType": 1,
                  "defaultValue":0
              }, 
              {
                  "columnName": "column2", 
                  "columnOID": 2, 
                  "dataType": 70, 
                  "accessType": 1,
                  "defaultValue":0
              }, 
              {
                  "columnName": "column3", 
                  "columnOID": 3, 
                  "dataType": 70, 
                  "accessType": 1,
                  "defaultValue":0
              },
  
          ]
      }
  
  
  
   public static MOTable&lt;MOTableRow&lt;Variable&gt;, MOColumn&lt;Variable&gt;, MOTableModel&lt;MOTableRow&lt;Variable&gt;&gt;&gt; createTableFromJSON(
          JSONObject data) {
      MOTable table = null;
  
      if (data != null) {
          MOTableSubIndex[] subIndex = new MOTableSubIndex[] { moFactory
                  .createSubIndex(null, SMIConstants.SYNTAX_INTEGER, 1, 100) };
          MOTableIndex index = moFactory.createIndex(subIndex, false,
                  new MOTableIndexValidator() {
                      public boolean isValidIndex(OID index) {
                          boolean isValidIndex = true;
                          return isValidIndex;
                      }
                  });
          Object indexesObj = data.get("indexValues");
          if(indexesObj!=null){
              String indexes = data.getString("indexValues");
              String tableOID = data.getString("tableId");
              JSONArray columnArray = data.getJSONArray("columns");
              int columnSize = columnArray.size();
              MOColumn[] columns = new MOColumn[columnSize];
              Variable[] initialValues = new Variable[columnSize];
              for (int i = 0; i &lt; columnSize; i++) {
                  JSONObject columnObject = columnArray.getJSONObject(i);
                  columns[i] = moFactory.createColumn(columnObject
                          .getInt("columnOID"), columnObject.getInt("dataType"),
                          moFactory.createAccess(columnObject
                                  .getInt("accessType")));
                  initialValues[i] = getVariable(columnObject.get("defaultValue"));
  
              }
  
              MOTableModel tableModel = moFactory.createTableModel(new OID(
                      tableOID), index, columns);
  
              table = moFactory.createTable(new OID(tableOID), index, columns,
                      tableModel);
              String[] indexArrString = indexes.split(";");
              for(String indexStr: indexArrString){
                  MOTableRow&lt;Variable&gt; row = createRow(new Integer(indexStr.trim()), initialValues);
                  table.addRow(row);
              }
          }
          }
  
      return table;
  
  }
  </code></pre>