+44(0)1908738254
YOUR EXPERT RPA PARTNER

Team up with our RPA strategy and tech specialists for maximum automation impact

Find out more
Harness the power of UiPath in your business.
WATCH NOW

Save money and spend more time on priority work.

Book consultation
READY, SET, AUTOMATE

Let's choose, design and deploy a process automation solution for your business.

Find out more
TRANSFORM YOUR BUSINESS

Let's analyse your business to discover opportunities for innovation and automation.

Find out more

Begin your business transformation journey

Book consultation
AUTOMATE EVERY FUNCTION

Automate where it matters most. Scale to solve challenges in every area

Find out more
GIVE EVERY TEAM THE TOOLS FOR SUCCESS

Equip people with user-friendly solutions that save time and make work easier

Find out more

Which business problem
can we solve first?

Book consultation
01 May 2015

Using K2 SmartForm Expressions and Conditional Styles Simultaneously

We have previously talked about the different uses of K2 SmartForms expressions, but today we will be using these expressions in combination with conditional styling. The example we will be using is to display a progress percentage together with a progress colour for grouped activities.

K2 Automated Testing Software

BenchQA allows full test automation of K2, including fully automated K2 SmartForms and K2 Workflow testing. It promotes test driven development for K2 and ensures continued quality assurance for K2 solutions. Easily apply changes to test cases to accommodate changes to K2 apps and ensure all apps are regression tested to avoid defects and assure continuous quality.

 

Free K2 Five Upgrade Review

k2 smartforms expressions

When you use expressions in a K2 ListView that reference a K2 SmartObject property, it is best to not bind the column to any property. Essentially you will do the binding in the expression itself. When you select the column and navigate to the body properties you can see an expression has been selected and conditional styling set up.

K2 SmartForms Expressions & Conditional Styles - 2

First we will look at the conditional styling. For each conditional style you add you have to specify a condition as well as a style.

K2 SmartForms Expressions & Conditional Styles - 3

When you specify the style you have access to the exact same formatting options as you do when normally specifying the style of any K2 SmartForms control. For this example we changed the background colour (green, amber and red respectively) and font colour (white).

K2 SmartForms Expressions & Conditional Styles - 4

When you set up the condition associated with the style it works almost like a normal K2 expression, just limited to a basic if-statement. You have access to the SmartObject on your current K2 View (or all view on the current K2 SmartForm) and you can also use other expressions..

K2 SmartForms Expressions & Conditional Styles - 5

When you set up the expression you have access to the SmartObject on your current K2 View (or all view on the current K2 SmartForm), other expressions as well as a list of operators. At the bottom of the screen you will see a preview of your expression in it’s current form.

K2 SmartForms Expressions & Conditional Styles - 6

Need further technical advice or support?