Release Automation

  • 1.  How to loop through a collection of parameters?

    Posted Jul 01, 2015 04:59 AM

    I have a collection of parameters and I would like to create a flow that checks each value of the parameters in the collection. I think this should be possible using a loop with a collection in a flow. But how can I check each parameter name/value inside the loop?

    How do I refer to the parameter within the loop?

    What I would liek to do is:

    Collection: param1, param2,

    Create a flow => For each param check if value <> NOTSET



  • 2.  Re: How to loop through a collection of parameters?

    Posted Jul 01, 2015 07:12 AM

    For each collection you need to define element parameters  which you will use later on in your flow and run the comparison action with the relevant element parameter (For comparison you can use actions such as compare to strings , extract regular expression test from string etc...)

    Thanks

    Jacky



  • 3.  Re: How to loop through a collection of parameters?

    Posted Jul 01, 2015 07:26 AM

    Jacky,

    Thanks – what I don’t understand is how to refer to the parameter from within the action.

    How can I compare the parameter of the collection to a value (how do I reference it in the loop)?

    If I have 10 parameters in the collection, how do I refer to the parameter which is currently under evaluation?

    Kind Regards,

    Johan



  • 4.  Re: How to loop through a collection of parameters?
    Best Answer

    Posted Jul 01, 2015 07:52 AM

    First create collection parameter and add the relevant elements

    element.png

    Next your compare action should use the parameter Name

    element.png

     

     

    Thanks

    Jacky



  • 5.  Re: How to loop through a collection of parameters?

    Posted Jul 01, 2015 09:52 AM

    Jacky,

    You’re hardcoding the name of your parameter (named “Name”) in your action.

    If in your collection element you have multiple parameters Name1, Name2, … NameX how can you loop through every parameter and check that none of them are set to “NOTSET”

    without adding X actions – I want to use a real loop with just 1 action …

    Kind Regards,

    Johan



  • 6.  Re: How to loop through a collection of parameters?

    Posted Jul 01, 2015 11:11 AM

    Johan, I think Jacky was thinking the same thing I was -- you were trying to loop through a series of collections.

     

    Instead, you're trying to loop through each of the collection members, is that it?

     

    I'm not sure if there is any way to do what you are trying to do.......

     

    Why do you have it defined that way?

     

    I would define the collection with a single parameter, (called name), then add each of the values to it in a loop, then you can check the value in a single action inside a loop the way Jacky described.

     

    Does that make sense?



  • 7.  Re: How to loop through a collection of parameters?

    Posted Jul 02, 2015 02:33 AM

    Correct, I’m trying to loop through each member (that’s what a loop should be used for right ;).

     

    The alternative seems workable – thanks!!!

    Johan



  • 8.  Re: How to loop through a collection of parameters?

    Posted Jul 02, 2015 02:42 AM

    If you trying to loop on each element (collection member) you probably should use string array parameter and not collection parameter