Active IQ Unified Manager Discussions

Error accessing 1 row table with getValueAt function

francoisbnc
2,999 Views

Hello,

I experience the following error when I try to access an one row table with getValueAt function.

Failed to resolve expression ' getValueAt($newlunssizetable,IndexLunSource)

 

$newlunssizetable is a input parameter as table.

IndexLunSource is the index in a loop represented by getSize($luns)

 

$lun is a imput parameter multiselect SQL query 

SELECT
  lun.full_path,
  ROUND(lun.size_mb / 1024,  
  0) AS Size
FROM
  cm_storage.lun AS lun,
  cm_storage.vserver AS vserver,
  cm_storage.volume AS volume
WHERE
  lun.vserver_id = vserver.id
  AND lun.volume_id = volume.id
  AND volume.name = '${myVol}'
  AND vserver.name = '${Mysvm}'

 

If the the table is more that one row, it works fine.

 

2015-01-05_13-36-14.png

 

The certified command works with 1 dim 1 row array

 def getValueAt(arrayVar, index)

{
  return arrayVar.split(",")[index-1];
}

 

 

 

Any ideas welcome.

 

François

2 REPLIES 2

francoisbnc
2,956 Views

Seems that is a complicated example, to simplify:

I just create wokflow (in attachment ) with no-ops command and I added an input parameter $inputparameter as table.

 

This is the content of no-op

 

getValueAt($inputtable,1)

 

The problem occurs with numeric entry and when table have only one row.

 

multiple rows  or alphanumeric entry: OK

 

 

2015-01-06_17-34-43.png2015-01-06_17-34-57.png

 

 

 

2015-01-06_17-34-06.png2015-01-06_17-34-29.png

2015-01-06_17-39-38.png2015-01-06_17-39-52.png

sinhaa
2,941 Views

Hi Francois,

 

This behviour of failure when using 1 numeric entry is strange, I'm looking to see why this happens. If you want to be able to proceed, you can put the numberic is single quotes like '11' and it will work fine.

 

testtable.png

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
Public