Skip to main content

 

 

Coupa Success Portal

Expressions-based Conditionality

Introduction

Risk Assess features expressions-based conditionality within Risk Assess programs. Users can configure questions to be conditional based on responses to KPI- and component-level questions with the Expression System language. 

Program administrators have the ability to get to the level of specificity they need in order to assess the risk of doing business with a supplier.

How it works

Risk Assess now includes an updated expression system in conditionality. Below is a list of basic rules for the new system:

  • Users can write expressions on the KPI types and components listed below.
  • Users can only write conditional expressions (i.e., expressions that evaluate to true/false)
  • Only one expression statement can be added per KPI. However, users can write compound statements (e.g., KPI[1.1] == "Yes" AND KPI[2.1] == "No")
  • Expressions are not case sensitive
  • Expressions are used to determine if a question will show based on a response from a previous question (e.g., Show question 2 if question 1 is "Yes"). The expression statement is written on question 2
  • Expressions can be written to determine whether to display components or KPIs based on the answer to a program’s KPI, other KPIs of the program, or component
  • Expressions are written in the program wizard on a new conditionality page
    • If an expression is included in the Expression field, it will hide/show the KPI
    • If an expression is included in the Component Expression field, it will hide/show the component
  • Users may save their work on the Conditions page to finish later—even if their expressions are invalid

The Enable Copy Previous Item Results program option may overwrite the visibility (i.e., hiding/showing a KPI or component) set by expressions. As a result, we recommend that you disable this option if you run your program as robo.

KPI expression statements

Conditionality Screenshot 1.png

Below are examples of KPI expression statements in Risk Assess. This feature has been available since version r19.7.0.

KPI  Expression Statement Examples
Yes/No
  • KPI[1.1] == "Yes"
  • KPI[1.1] == "No"
IsNull/IsNotNull
  • IsNull(KPI[1.0])
  • IsNotNull(KPI[1.0])
Numeric
  • KPI[1.1] >= 50
  • KPI[1.1] <= 80
  • KPI[1.1] != 50
  • KPI[1.1] == 50
  • KPI[1.1] >= 30 AND KPI[1.1] <= 90
  • KPI[1.1] <= 30 OR KPI[1.1] >= 70

Component expression statements

Users can now write conditional expression statements on select components.

When a component is referenced in an expression statement, the field name of the component should be referenced. Do not refer to the display name of the component.

Similarly, if the expression statement refers to a setup data value, the setup code should be referenced. Do not refer to the display name of the setup data value.

This feature has been available since version r19.8.0.

 

Components Expression Statement Examples Use Case
  • Basic Calendar
  • Calendar Workflow
  • KPI[1.1].component["Contract_Date"].value == DATE("June, 2019")
  • KPI[1.3].component["Contract_Date"].value != DATE("06-21-2019")
  • KPI[1.5].component["Contract_Date"].value <= DATE("June, 2019")

  • KPI[1.7].component["Contract_Date"].value >= DATE("06-21-2019")

  • IsNull(KPI[1.5].component["Contract_Date"].value)
  • IsNotNull(KPI[1.7].component["Contract_Date"].value)
  • KPI[1.9].component["Contract_Date"].value == DATE("Friday, June 21, 2019") And IsNull(KPI[1.10].component["Contract_Date"].value)
  • KPI[1.9].component["Contract_Date"].value == DATE("Friday, August 1, 2019") Or IsNull(KPI[1.10].component["Contract_Date"].value)
  • Reference a contract start date or contract end date.
  • Reference a last audit date.
  • Setup Data Dropdown
  • Setup Data Radio Button
  • Setup Data Radio Button with Other
  • KPI[1.1].component["Bank_Country"].value == "US"
  • KPI[1.3].component["Bank_Country"].value != "RU"
  • IsNull(KPI[1.5].component["Bank_Country"].value)
  • IsNotNull(KPI[1.7].component["Bank_Country"].value)
  • KPI[1.9].component["Bank_Country"].value == "US" And IsNull(KPI[1.10].component["Bank_Country"].value)
  • KPI[1.9].component["Bank_Country"].value == "US" Or IsNull(KPI[1.10].component["Bank_Country"].value)
  • Show or hide questions based on a dropdown menu selection such as a country of origin selection.
  • Setup Data Checkbox
  • Setup Data Checkbox with Other
  • Setup Multi-Select
  • KPI[1.1].component["Bank_Country"].value == {"US", “RU”}

  • KPI[1.3].component["Bank_Country"].value != {"RU"}

  • IsNull(KPI[1.5].component["Bank_Country"].value)

  • IsNotNull(KPI[1.7].component["Bank_Country"].value)

  • KPI[1.5].component["Bank_Country"].value AllIn {"US", "RU"}

  • KPI[1.6].component["Bank_Country"].value Not AllIn {"US", "RU"}

  • {"RU", "US"} AllIn KPI[1.5].component["Bank_Country"].value

  • {"RU", "US"} Not AllIn KPI[1.7].component["Bank_Country"].value

  • KPI[1.7].component["Bank_Country"].value AnyIn {"US", "RU"}

  • KPI[1.8].component["Bank_Country"].value Not AnyIn {"US", "RU"}

  • {"RU", "US"} AnyIn KPI[1.5].component["Bank_Country"].value

  • {"RU", "US"} Not AnyIn KPI[1.7].component["Bank_Country"].value

  • KPI[1.9].component["Bank_Country"].value == {"US", “RU”} Or IsNull(KPI[1.10].component["Bank_Country"].value)

  • KPI[1.9].component["Bank_Country"].value == {"US"} And IsNull(KPI[1.10].component["Bank_Country"].value)

These components act as a list and as a result, curly braces {} must be included around your values.

In addition, the AnyIn and AllIn functions only work with Setup Data Checkbox, Setup Data Checkbox with Other, and Setup Multi-Select Components.

  • Show or hide questions based on a checkbox list selection such as a country of origin selection.
Money
  • KPI[1.1].component[“contract_amount”].value == 100000
  • KPI[1.1].component[“contract_amount”].value != 100000
  • KPI[1.1].component[“contract_amount”].value <= 100000
  • KPI[1.1].component[“contract_amount”].value >= 100000
  • IsNull(KPI[1.5].component["contract_amount"].value)
  • IsNotNull(KPI[1.7].component["contract_amount"].value)
  • Show or hide questions based on a numeric value such as a contract amount.

Syntax

General syntax for expression statements include the following:

  • The order of operations for Expressions follow the standard mathematical order of operations (i.e., Exponents, multiplication & division, and addition & subtraction).
  • White space is ignored.
  • The specific formats for referring to Risk Assess data, Survey and Workflow identifiers, and attributes are described below.

Punctuation

Punctuation is the set of symbols used to implement the grammatical structure of the syntax by separating or grouping.

Separators Symbol Use

Comma

,

Used for separating items in a list

Double quotes

" "

Used for defining a string

Backward slash

\

Used to permit special characters such as “ (to use a string) or \

Groupings

Symbol

Use / example

Braces

{ }

Used for grouping list items (separated by commas)

Parentheses

( )

Used in functions and some specific statements

Square brackets

[ ]

Used to refer to a specific survey section, question, response, KPI, or component

Symbols

Symbol

Use / example

Question mark

?

Shortcut symbol used in if/then/else conditional statements to replace then

Colon

:

Shortcut symbol used in if/then/else conditional statements to replace else

Functions

A function is a pre-defined formula for performing calculations or executing commands on one or more parameters.

Defined Functions Use Notes

COUNT

Count items in a group

MIN

Minimum

MAX

Maximum

AVERAGE

Average

SUM

Sum

MEDIAN

Median

STDDEV

Standard deviation

VARIANCE

Variance

DATEDIFF

Date difference

 

To define the time unit, include one of the following in double quotation marks preceding the list of dates: days, months, years, quarters, weeks, hours, minutes    

DATE

Date

ISNULL

Is null

ISNOTNULL

Is not null

TODAY

Today's date

This is the date in Coordinated Universal Time (UTC) at the moment of the expression's execution.

DATEADD

Add to a date by day, month, or year

Day: KPI[1.1].component["BasicCalendar"].value == DateAdd("d", 1, launch_date)
Month: KPI[1.1].component["BasicCalendar"].value == DateAdd("m", 1, today())
Year: KPI[1.1].component["BasicCalendar"].value == DateAdd("yyyy", 1, Date("09/13/2019"))

DATESUB

Subtract from a date by day, month, or year

Day: KPI[1.1].component["BasicCalendar"].value == DateSub("d", 1, launch_date)
Month: KPI[1.1].component["BasicCalendar"].value == DateSub("m", 1, today())
Year: KPI[1.1].component["BasicCalendar"].value == DateSub("yyyy", 1, Date("09/13/2019")

Keywords

Keywords are defined words which cannot be used for any other purpose (e.g., these words cannot be used as variable names).

Defined keywords

Use Notes

IF / THEN / ELSE

 

IN

 

NOT

Can spell out “NOT” or use exclamation point (!)

TRUE / FALSE

 

AND

Can spell out “AND” or use single ampersand (&) or double ampersand (&&)

OR

Can spell out “OR” or use single pipe (|) or double pipe (||)

KPI

 

COMPONENT

 

VISIBILITY

 

REQUIRED

 

TEXT

 

VALUE

 

DATE

 

MIN / MAX

 

AVERAGE

 

SUM

 

MEDIAN

 

STDDEV

 

VARIANCE

 

DATEDIFF

 

ISNULL / ISNOTNULL

 

MONTH

 

Operators

Operators are designated symbols, words, or phrases used for checking, changing, or combining values.

Operators

Use Notes

+

Add

-

Subtract

*

Multiply

/

Divide

!

Use in front of an expression to indicate the inverse of the expression.

Can spell out “NOT” or use exclamation point (!)

>

Greater than

>=

Greater than or equal to

<

Less than

<=

Less than or equal to

==

Is equal to

Test of equality (conditional)

!== ; !=

Is not equal to

Test of inequality (conditional)

AND

&

&&

Boolean operator (resolves to true or false) used with conditional expressions.

 

Can spell out “AND” or use single ampersand (&) or double ampersand (&&)

OR

|

||

Boolean operator (resolves to true or false) used with conditional expressions.

 

Can spell out “OR” or use single pipe (|) or double pipe (||)

^

Power

IN

Determine whether a variable is included in a list. Must be followed by a list.

!IN

Not in a defined list

=

This is used to write assignment statements and cannot be used in an expression. Means “is.”

This operator cannot be used in conditional expressions.

NOT Not
ALLIN All in
ANYIN Any in
CONTAINSALL

Contains all

The CONTAINSALL operator determines whether a specified string or list of strings is present within a component or KPI with string values. This operator is not case sensitive.

It does not matter whether a component or KPI is on the left or on the right of this operator. For example:

“the quick red fox jumped over the lazy dog” ContainsAll KPI[1.1].component["product_description"].value

Upgrade Impact

All programs created before this update will automatically migrate to the new conditionality format.

Previously, conditionality in a program allowed you to make additional questions appear depending on answers to specific yes/no questions.

Conditionality Screenshot 2.png

In addition, you will now select KPI lines to show rather than hide.

  • Was this article helpful?