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!
Discussion posts and replies are publicly visible
Sure. You can make the color depending on any condition you like. Setting validate to true on any button is not necessary for this.
Unfortunately, I tried in many ways but it didn't work!
What are "many ways" and what did not work?
Thanks Stefan! I tried to put validate in the next button and to counter, if the counter are not the same that means this step has an issue then I tried to change the color of it but from what I understood the Stamp field has to take only one Icon.
So, when I do my personal research to understand a certain problem situation, I start with a very minimal version of it. Once I understand it and I found a solution to make it work, I assemble the larger solution.
Translating this to your case, any parameter of a stamp field can have its own logic to define the value. Play around with this.
Then, you need to understand that the validation setting of a button only controls the behaviour of input fields regarding their required and validations parameters. Nothing else.
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" ) )
Thank you for your reply!
I believe for backgroundColor I can't add two if conditions, should I use OR operator to do that ?
We can have nested "if" anywhere "if" is allowed. Please refer to the following sample code.
Ex.
if( <Condition1>, <Action1>, if( <Condition2>, <Action2>, <Else Part> ) ) /* ------------------------------------------- */ backgroundColor: if( <Condition>, "NEGATIVE", if( fv!index < local!currentFormStep, "POSITIVE", if( fv!index > local!currentFormStep, "#949494", "ACCENT" ) )