Skip to Content
avatar image
Former Member

What is the syntax for If x contains ...


I've tried

KF Debit Memo

'KF Debit Memo'

"KF Debit Memo"

... but it is not getting caught?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    May 07, 2015 at 08:05 AM


    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 30, 2015 at 09:18 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 30, 2015 at 01:10 PM


    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 30, 2015 at 02:17 PM

    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?

    Add comment
    10|10000 characters needed characters exceeded

    • 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