Logic Rule (Number/Date Comparison)

Last Updated September 28, 2026

Brief Overview

Logic rule allows you to create logic statement in the Rule Engine based on dynamic text attributes and predefined constants, to compare fields including: dates, numbers, and monetary values by using arithmetic expressions.

Did you know?

Logic rule is called "Number/Date comparison" in the Condition Builder.

Use Cases

  • Date comparison
  • Monetary value comparison

Here are some in depth examples of the way you might use logic rules in a solution:

Trigger a ShoutOut close to a due date

You can use a logic rule to trigger a ShoutOut in the final days before a due date, to remind users that the deadline is coming up and encourage a final effort.

To do so:

  • Create an attribute called DueDate
  • Create the following Logic Rule - @DueDate - today <= 5days

Check if the commit value is equal to the total opportunity value

You can use a logic rule to easily compare numbers and see if the commit value is equal to the total opportunity value.

  • Create dynamic text attributes for both fields - Commit & Total Opportunity
  • Create the following logic rule - @Commit != @TotalOpportunity

How to use a Logic Rule

  1. In the Rule Engine, select Logic Rule from the dropdown list
  2. Enter your logic statement in the highlighted field

How to Create a Logic Statement

A logic rule should be written in the form of an equation/in-equation, for example:

  • @Date1 - Today < 10Days
  • @Attribute1 + @Attribute2 == @Attribute3

While creating the logic rule, a preview bar will display the values in the dynamic fields as long as they appear on the webpage that is connected to the editor at that time.

Using Dynamic Text Attributes

  • To add an attribute, simply type @ and choose an attribute from the dropdown list
  • You can begin typing the attribute name to filter the list
  • You can add as many attributes as you want

  • It is also possible to create new and manage existing attributes directly from the Rule Engine when using the logic rule

Using Dynamic Text Attributes with Static Text Values

Attributes with static text values can be created and used for the comparisons in logic rules.

Example:
@dateTest is the on screen element with a date and @absoluteDate is the static date value.
The builder can now compare the dynamic date on the screen with a predefined date of their choosing.

Note

While using Text type of attributes for static dates is still supported, it is also possible now and recommended to use the new Date type.

Using a predefined constant

Simply type one of the following constants:

Constant Remarks          
second Can also use "seconds"
minute Can also use "minutes"
hour Can also use "hours"
day Can also use "days"
year Can also use "years"
today Returns today's dynamic date, for example - 30/07/2020
now Returns today's dynamic date & time, for example - 30/07/2020 18:30:45
Note

  • Capitalization doesn't affect constants
  • You can multiply constants by typing a number next to the constant
    • For example: 10day or 2year

Using arithmetic actions and comparison

You can use arithmetic actions to add, subtract, divide or multiply attributes. For example:

@Att1/12
@Att2*Att3
@Att4+@Att5
@Date1-today

To compare sides of the equation, use one of the following symbols:

Symbol Meaning
== Equal
!= Not Equal
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to

Technical Notes

How logic rules read dates

WalkMe detects and converts the date format automatically in the following applications:

  • SAP Concur
  • Microsoft Dynamics
  • Salesforce Lightning
  • In other applications, WalkMe uses the date format set in the browser's locale
  • If you know the date format your users see, set it in the dynamic attribute settings - This overrides the browser's locale

Supported date formats

  • Standard numeric date formats are supported
    • For example: mm/dd/yyyy and mm.dd.yyyy
  • The following text-based date formats are supported:
    • dd-MMM-yyyy, for example: 12-AUG-2022
    • Month d, yyyy, for example: January 21, 2022
    • Mth d, yyyy, for example: Jan 21, 2022
    • d month yyyy, for example: 21 January 2022
  • Day, month, and year separated by slashes, with the month written as text, for example: 29/NOV/2024, 29/Nov/2024, 29/november/2024, 29/November/2024, 7/mar/1989, 07/mar/2024, and 7/MARCH/2028
  • Dates are supported in English and other languages
    • If dates in another language don't evaluate correctly, reach out to your Customer Success Manager or WalkMe contact

Unsupported dates

  • Date fields that split the day, month, and year into separate on-screen elements aren't supported
    • This field structure can appear in any application, for example Workday® and Encompass®
  • Text-based date formats not listed under Supported date formats aren't supported, for example: Dec. 2, 2021
  • Logic rules can't evaluate dates before January 1, 1970

Numbers and text

  • Logic rules compare numbers and values that evaluate as numbers, like dates - They don't compare text strings the way other Rule Engine operators do
  • If a value mixes text and numbers, the logic rule extracts the first number and ignores the text
  • The largest number logic rules can represent precisely is 9007199254740991 - Larger numbers are rounded to 16 digits followed by zeros
    • For example: 123456789123456789123 becomes 123456789123456800000.

Attributes and values

  • Logic rules only accept predefined constants typed directly into the rule - To use any other value, like a date, number, or text, create an attribute for it
  • When you use a jQuery selector as a dynamic attribute, select the element that directly holds the text, not one of its parent elements
  • Data saved with ActionBot isn't supported in logic rules - ActionBot saves data as an object for use in a Smart Walk-Thru

Troubleshooting

Logic rule shows "invalid date" for an on-screen date

  • When a logic rule uses an attribute based on an on-screen date, WalkMe reads that date using the browser locale. If the date format on the site doesn't match your browser's locale, the logic rule can show "invalid date."
  • For example, a site uses the en_IL locale, which formats dates as DD/MM/YY. Your browser is set to en_US, which expects MM/DD/YY. When the site shows 23/2/22, the logic rule reads 23 as the month. Since there's no 23rd month, it shows "invalid date."
  • If the site's date format matches your browser's locale, the logic rule reads the date correctly. In the published environment, WalkMe reads on-screen dates using each user's browser locale. For example, 3/4/22 is read as March 4 for a user with an en_US locale, and as April 3 for a user with a European locale.
  • To fix this, set the date format in the dynamic attribute settings so it matches the format on the site. This overrides the browser's locale.

Fixed date evaluates differently for different users

  • When you use a Text type attribute for a fixed date, WalkMe saves the date as a string. WalkMe then reads that string using the browser locale of whoever evaluates the rule. That's you in the Rule Engine, and each user in the published environment.
  • For example, you type 3/4/22 and your browser locale is en_US, so the Rule Engine reads it as March 4. A user with a European locale may have the same date read as April 3, which can lead to incorrect results.

How to Video

Was this article helpful?

Thanks for your feedback!

Be part of something bigger.

Engage with peers, ask questions, share ideas

Ask the Community
×
×
The trademarks and product names of Workday, Inc., including the WORKDAY® mark, are the property of Workday, Inc. WalkMe is not affiliated with Workday, Inc., nor does Workday, Inc. sponsor or endorse WalkMe, its services or its website.