Clarity PPM

Expand all | Collapse all

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

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

    Posted 03-20-2019 03:04 AM

    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?



  • 2.  Re: In a GEL script, could we query data stored in an array-type variable?

    Posted 03-20-2019 04:26 AM

    Just have an "IF" when you are reading from the file?

    (i.e. only load data into vFile "IF" the GROUPID = 'groupB')