Question

How to pass multiple values using single runtime parameter variable?

  • 12 June 2023
  • 4 replies
  • 79 views

Passing multiple values using single runtime parameter variable.

eg: cmpy_code variable should contain values like A123, B456, 0C56...etc

which can be accessed through runtime parameter in a pipeline.

Similar to IN operator in DB.

 

 


4 replies

Userlevel 4
Badge

@Priyabala 

You can pass them with a separator and within your processor stage you can use them accordingly. Or if A123, B456, 0C56 values are part of a record and you want to send these as a parameter by Start Jobs processor then you can use code or Expression evaluator to create a single string and then pass this to the called Job.

Userlevel 5
Badge +1

@Priyabala 

Below screen-shots for your reference as suggested by @saleempothiwala 

 

 

 

Hi @Bikram 

can you please suggest an approach for reading the same data1 variable (having multiple values, separated by comma) by using expression evaluator.

I need to verify, whether the input record flowing from source contains any one of the data present in data1 variable.

Userlevel 4
Badge

@Priyabala 

 

Here is a way to do this

 

Dev Data Source has a field called f1 with a value of ‘abc’

 

I have created a parameter called data1 with value 0000;abc;1234;defg;3244;2222

 

Use Expression evaluator to split the parameter to a list of values

 

Add Javascriot evaluator and following code

var matchFound = false;
for (var j = 0; j < records[i].value.split.length; j++) {
if (records[i].value.split[j] === records[i].value.f1) {
matchFound = true;
break;
}
}

 

The output looks like this

 

 

If i change the parameter to 0000;abcd;1234;defg;3244;2222. I get false

 

 

I hope it helps.

Reply