Community maintenance is complete. Thank you for your patience!

Active IQ Unified Manager Discussions

Row Loop variable

rogerhinson

Hi,

 

I'm starting with a list of IQNs entered in CSV format from an input variable, iqnList, to create multiple igroups based on the server name

 

Example is:  iqn.1994-05.com.redhat:john, iqn.1994-05.com.redhat:joe, iqn.1994-05.com.redhat:bob

 

I created a function, getServerFromIQN that takes the iqn name and just leaves the host name.

 

I create a row loop for Number of Time with Number of Times equal to getSize($iqnList)

 

The Variable Index is set to iGroupIdx

 

Variable Name is iGroupName

Initial Value is getServerFromIQN(getValueAt($iqnList,1))

Expression is getServerFromIQN(getValueAt($iqnList,iGroupIdx+1))

 

My problem is that if the the Expression is performed after the last item in my list and so there isn't an iGroupIdx+1 to look at and I get an error.

 

How can I set the Expression to only evaluate if the size of the list is less than the iGroupIdx?  I tried an if/then, but got an error evaluating the expression.

 

This is WFA 2.2.

 

Thanks,

Roger

 

 

 

1 ACCEPTED SOLUTION

karale

Hi Roger,

Can you try

(iGroupIdx<= getSize($iqnList))?getServerFromIQN(getValueAt($iqnList,iGroupIdx+1)):0

in express column?

View solution in original post

4 REPLIES 4

abhit

Hi:


Can you please try with:

getServerFromIQN(getValueAt($iqnList,iGroupIdx));

 

Regards

Abhi

 

rogerhinson

Hi,

 

When I remove the +1, I don't get an error, but it loops through the first item twice.  I'm doing a NoOp to see if the igroup exists before creating it and end up with incorrect results when I remove the +1.

 

I think I need the expression, to not calculate on the last iteration.

 

I've attached the dar file to help out.

 

Thanks,

Roger

 

 

karale

Hi Roger,

Can you try

(iGroupIdx<= getSize($iqnList))?getServerFromIQN(getValueAt($iqnList,iGroupIdx+1)):0

in express column?

View solution in original post

rogerhinson

Thanks Karale,

 

That's what I was looking for..  I need to make it just < instead of <=, but now it works just as I wanted..

 

Thanks again,

Roger

 

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public