Skip to main content
April 20, 2022
Solved

switch or case statement

  • April 20, 2022
  • 5 replies
  • 1 view

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

    5 replies

    mikes0011
    mikes0011Answer
    Brainy
    April 20, 2022
    April 20, 2022

    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
    April 20, 2022

    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
    April 20, 2022

    Or go with a decision table.

    April 20, 2022

    Thanks for your response to my post.

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