Action Button: Dynamic Display

Is there a way to have an action button on a case only display based off of another field on the case?  I have a 'case subtype" field which has a dropdown of many options.  I would like the Action button to only be visible on the case if the case subtype is 'Transfer Request'.  I have tried several options, but need some help with the formula. 

equal($case_subtype_c,"Transfer Request"),"true"))

Parents
  • Hi  ,

    When looking to validate a formula based on a dropdown field value, I recommend using the isInList() formula. equal() can also be used, but isInList() is more versatile for future modifications if your requirements change. Using isInList(), you would do the following:

    isInList(
        $case_subtype_c,
        createList(
            "Transfer Request"
        )
    )

    The reason I recommend this formula is that it is much easier to add in additional validation checks later on. The formula would updated like the following if you wanted the action button to show under multiple conditions:

    isInList(
        $case_subtype_c,
        createList(
            "Transfer Request",
            "Option ABC",
            "Option XYZ"
        )
    )

    If you prefer to use the equal() formula, it only accepts two parameters to compare so the syntax would be like this:

    equal(
        $case_subtype_c,
        "Transfer Request"
    )

    If you wanted to add additional conditions later on, the formula becomes a lot more cumbersome in my opinion as you have to wrap everything in an or() formula and replicate the equal() formula for each condition:

    or(
        equal(
            $case_subtype_c,
            "Transfer Request"
        ),
        equal(
            $case_subtype_c,
            "Option ABC"
        ),
        equal(
            $case_subtype_c,
            "Option XYZ"
        )
    )

    I hope this helps!

    Chris

Reply
  • Hi  ,

    When looking to validate a formula based on a dropdown field value, I recommend using the isInList() formula. equal() can also be used, but isInList() is more versatile for future modifications if your requirements change. Using isInList(), you would do the following:

    isInList(
        $case_subtype_c,
        createList(
            "Transfer Request"
        )
    )

    The reason I recommend this formula is that it is much easier to add in additional validation checks later on. The formula would updated like the following if you wanted the action button to show under multiple conditions:

    isInList(
        $case_subtype_c,
        createList(
            "Transfer Request",
            "Option ABC",
            "Option XYZ"
        )
    )

    If you prefer to use the equal() formula, it only accepts two parameters to compare so the syntax would be like this:

    equal(
        $case_subtype_c,
        "Transfer Request"
    )

    If you wanted to add additional conditions later on, the formula becomes a lot more cumbersome in my opinion as you have to wrap everything in an or() formula and replicate the equal() formula for each condition:

    or(
        equal(
            $case_subtype_c,
            "Transfer Request"
        ),
        equal(
            $case_subtype_c,
            "Option ABC"
        ),
        equal(
            $case_subtype_c,
            "Option XYZ"
        )
    )

    I hope this helps!

    Chris

Children