Skip to main content
saraha1139
Participating Frequently
Feb 14, 2023 6:55 AM UTC
Question

Form Steps

Hello, 

I'm working on project and using the same form steps as "https://docs.appian.com/suite/help/21.2/form-steps-pattern.html", 
I'd like to change the color for the stamp field to be red if there's an error in the step. I added "validate: true() " to the next button.
Is that possible to moving forward to the next step and just change the color if the step contains an error. 

Thank you for your help!


8 replies

stefanhelzle0001
Brainy
Feb 14, 2023 7:27 AM UTC

Sure. You can make the color depending on any condition you like. Setting validate to true on any button is not necessary for this.

saraha1139
Participating Frequently
Feb 15, 2023 8:46 AM UTC

Unfortunately, I tried in many ways but it didn't work! 

stefanhelzle0001
Brainy
Feb 15, 2023 9:00 AM UTC

What are "many ways" and what did not work?

abhayd3663
Brainy
Feb 21, 2023 4:08 AM UTC

You need to provide additional IF condition in following piece of code, when that specific condition is true you will return "NEGATIVE", instead of "POSITIVE" or "ACCENT".

                backgroundColor: if(
                  fv!index < local!currentFormStep,
                  "POSITIVE",
                  if(
                    fv!index > local!currentFormStep,
                    "#949494",
                    "ACCENT"
                  )
                )
saraha1139
Participating Frequently
Feb 21, 2023 1:23 PM UTC

Thank you for your reply!

I believe for backgroundColor I can't add two if conditions, should I use OR operator to do that ?

abhayd3663
Brainy
Feb 21, 2023 6:49 PM UTC

We can have nested "if" anywhere "if" is allowed. Please refer to the following sample code.

Ex.

if(
    ,
    ,
    if(
        ,
        ,
        
    )
)
/* ------------------------------------------- */
                backgroundColor: if(
                ,
                "NEGATIVE",
                if(
                  fv!index < local!currentFormStep,
                  "POSITIVE",
                  if(
                    fv!index > local!currentFormStep,
                    "#949494",
                    "ACCENT"
                  )
                )