Forum Discussion

Rev's avatar
Rev
New Contributor
2 years ago

passing multiselect combo-box as parameter

Hi,

 

ParamA will be a multiselect combo box and the same should be passed to business rule as well.

May I know how it can be done? I'm passing the parameter in calculate button, then DM step and then to BR.

Calc button : {seq_name}{ParamCC = |!ParamA!|}

DM step: {|!ParamCC!|}

BR: Get value of ParamCC

Need suggestion on how should it be passed if parameter is multiselect.

thanks

  • Hi. 

    You can split the string in the receiving business rule by delimiter e g comma

    Dim split as String() = args.NameValuePairs.XFGetValue("ParamCC").Split(",")

    Then loop through rresults to get each selection e.g

    For Each param As string in split

         ' Do Something 

    Next

     

  • seburn's avatar
    seburn
    New Contributor III

    Hi. 

    You can split the string in the receiving business rule by delimiter e g comma

    Dim split as String() = args.NameValuePairs.XFGetValue("ParamCC").Split(",")

    Then loop through rresults to get each selection e.g

    For Each param As string in split

         ' Do Something 

    Next

     

    • Rev's avatar
      Rev
      New Contributor

      Thanks Seburn.I tried the suggestions provided and it works partially.Means when list of members were passed in ParamCC, it works only for the first parameter.

      Dim split as String() = args.customcalculateargs.NameValuePairs.XFGetValue("ParamCC").Split(",")

      For Each param As string in split

            api.logmessage(param ) ( Im able to print each param)

           ' Do Something (but it works only for first parameter passed)

      Next

      • seburn's avatar
        seburn
        New Contributor III

        OK. I think you need to check you are passing in the param value via button AND DM step with square brackets around the parameter (see above). This behavior sounds like you are only picking up the first comma separated value  square brackets should fix 🙂

         

        E.g button

        seq_name}{ParamCC=[|!ParamA!|]}

        E.g DM step

        ParamCC=[|!ParamA!|]

  • seburn's avatar
    seburn
    New Contributor III

    P.s. make sure to put square brackets around the parameter passed in via button to pick up all comma separated values e.g

    {seq_name}{ParamCC=[|!ParamA!|]}