cancel
Showing results for
Search instead for
Did you mean:
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

## formula in crs (ivr)

How to write next formula is easier:

if (p_value == -1 && type == "01" && status == "01" || p_value == -1 && type == "01" && status == "04" || p_value == -1 && type == "01" && status == "05" || p_value == -1 && type == "01" && status == "06" || p_value == -1 && type == "02" && status == "01" ..... )

Data:

type = 01, type = 02, type = 05, type = 06

status = 01, status = 04, status = 05, status = 06

1 ACCEPTED SOLUTION

Accepted Solutions
Super Bronze

## Re: formula in crs (ivr)

Hi

Not sure if this is 'easier', but it may be shorter. This will *probably* require a premium license, but I can't realy test that here.

Try this:

1) Add a boolean variable called 'testresult' or whatever

2) Add a 'set' step, and set testresult to this:

`{String[] acceptStatus = new String[] {"01","04","05","06"};  // Set up list of types that should return trueString[] acceptTest = new String[] {"01","02","05","06"}; // Set up list of status that should return trueif (java.util.Arrays.asList(acceptStatus).contains(status)  && java.util.Arrays.asList(acceptTest).contains(type) && p_value  == -1){  return true; } else{  return false; }}`

3) You can then use 'testresult' as a test for the If step an do what you will under that.

Aaron

Please rate helpful posts....

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!
1 REPLY
Super Bronze

## Re: formula in crs (ivr)

Hi

Not sure if this is 'easier', but it may be shorter. This will *probably* require a premium license, but I can't realy test that here.

Try this:

1) Add a boolean variable called 'testresult' or whatever

2) Add a 'set' step, and set testresult to this:

`{String[] acceptStatus = new String[] {"01","04","05","06"};  // Set up list of types that should return trueString[] acceptTest = new String[] {"01","02","05","06"}; // Set up list of status that should return trueif (java.util.Arrays.asList(acceptStatus).contains(status)  && java.util.Arrays.asList(acceptTest).contains(type) && p_value  == -1){  return true; } else{  return false; }}`

3) You can then use 'testresult' as a test for the If step an do what you will under that.

Aaron

Please rate helpful posts....

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!
279
Views
0
Helpful
1
Replies