Skip to main content
Inspiring
Apr 20, 2022 3:00 PM UTC
Solved

switch or case statement

Hi,

Is there any equivalent to Switch or Case statements in Appian.

If I have to implement code similar to the below code line, how can I achieve in Appian.

Any suggessions.

CASE

WHEN ( action="A") THEN    WorkflowStatus="WAC", RequestStatus="RAC"

WHEN ( action="B") THEN    WorkflowStatus="WBC", RequestStatus="RBC"

WHEN ( action="C") THEN    WorkflowStatus="WCC", RequestStatus="RCC"

END CASE

    mikes0011
    mikes0011Answer
    Brainy
    Apr 20, 2022 3:04 PM UTC

    5 replies

    mikes0011
    mikes0011Answer
    Brainy
    Apr 20, 2022 3:04 PM UTC
    Inspiring
    Apr 20, 2022 7:29 PM UTC

    Thanks for replying to my message.

    Currently we are using version 21.4 and it seems to be a!match() has been introduced from 22.1

    mikes0011
    Brainy
    Apr 20, 2022 7:45 PM UTC

    The next best way, in general, is using nested IF statements, though if your values are generally going to be static and plaintext in nature, Stefan's suggestion of using a Decision table might be better.

    The Expression Guru
    stefanhelzle0001
    Brainy
    Apr 20, 2022 3:33 PM UTC

    Or go with a decision table.

    Inspiring
    Apr 20, 2022 7:30 PM UTC

    Thanks for your response to my post.

    I have never used decision table(s) earlier and not sure how this works. Need to explore.