AnsweredAssumed Answered

In a GEL script, could we query data stored in an array-type variable?

Question asked by Harvin on Mar 20, 2019
Latest reply on Mar 20, 2019 by Dave_3.0

We're trying to design a script where a part of it needs to read a csv file containing membership info of security groups in Clarity.

 

The contents of the feed looks something like:

 

USERID, GROUPID

user01, groupA

user02, groupA

user01, groupB

etc

 

From the snippet below, the data is loaded into the vFile variable.

 

<file:readFile fileName="${vRootDir}/testfolder/testcolumns.csv" delimiter="," var="vFile" embedded="false"/>

 

<!-- READ LINES OF FILE. SKIP THE HEADER LINE -->
<core:forEach items="${vFile.rows}" var="row" indexVar="i" begin="1" step="1">
<core:set value="${row[0]}@macquarie.com.au" var="vFirstColumn"/>
<core:set value="${row[6]}" var="vSecondColumn"/>
<gel:log category="INFO" level="INFO">NAME: ${vFirstColumn}, GROUP ${vSecondColumn}</gel:log>
</core:forEach>

Is there a way to query data from vFile eg we only want to output members of 'groupB' instead of all the contents?

Outcomes