How to maintain color codes for each iteration for different color in audit log?

Share with Love

In Appian, you can use the format() function to apply a specific color to each iteration of a loop in an audit log.

Here is an example of how you could use the format() function to apply different colors to each iteration in an audit log:

for (i = 1; i <= 10; i++) {
a!log(
text: format(
"This is iteration number {0}",
i,
color: if(i mod 2 = 0, "blue", "red")
)
)
}

This example will create an audit log with 10 iterations. The text for the even-numbered iterations will be displayed in blue, while the text for the odd-numbered iterations will be displayed in red.

You can use the format() function in combination with the if() function to apply different colors to different iterations of a loop, or to apply different formatting to different iterations based on some other condition.

I hope that helps! Let me know if you have any other questions.