cancel
Showing results for 
Search instead for 
Did you mean: 

What is the syntax for If x contains ...

Former Member
0 Kudos


I've tried

KF Debit Memo

'KF Debit Memo'

"KF Debit Memo"

... but it is not getting caught?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos


Thanks for the feedback guys. The problem was that I was copying the task bar message to a variable and then doing the test.

Contains does not work with a variable, only a screen field.

Answers (3)

Answers (3)

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

If these are dropdown field values, then use only the actual key value, not the key and description. So only KF.

Also, the IF statement will need the args reference as Sushant mentioned.

Former Member
0 Kudos

OK - I found the answer in a piece by Steve Rumsby ...

"  ....Because the Personas script IF only tests values in screen fields, I have a hidden field into which I paste a value that can be tested....."

These leaves a issue when you don't know what screen you're going to be on.

In DP91 RRB - attempting to create a Debit Memo Request can either take you to a flavour of DP91 or VA02 therefore you need to paste the task bar value into an on screen field on VA02 or DP91 .... how to I know which one to past to?

Any logic brain boxes out there?

0 Kudos

hi Patrick,

If you can put snapshot of your script, would be nice.

But, if you are declaring your variable in "calculate in js", then declare it as args.x = 'AA BB';

Then in IF action where you are checking "contains", instead of ses[0] (default you see when you create a new action), it should be args.x

IF condition also supports args.variable_name and had been since long I guess...

let me know if it works.

REgards,
Sushant

Former Member
0 Kudos


Anyone at all...

var X = "AAA BBB CCC"

IF X Contains AAA B doesn't seem to work ... do I need to use quote marks or anything?

I know I'm being stupid but a simple nudge would put me on the right track.

Thanks.

Patrick.