Writing and Using Formulas in Smart Forms and Registers

Modified on Thu, 11 Sep at 11:41 AM

Overview

This guide explains how to correctly write and apply formulas in Smart Forms and Registers within Cora PPM. It covers syntax rules, available system groups, field references, and practical examples.


Where Formulas Are Used

Formulas can be applied in multiple areas of Cora, including:

  • Smart Form fields (calculated values)

  • Register fields

  • Project Variables

  • System Constraints

  • User Attributes

  • Dropdown lists & Checkboxes (formatted with suffixes)


Formula Syntax Reference

Dates

Date calculations are supported by using suffixes:

  • N → returns decimal equivalent of a date

  • D → returns date equivalent of a decimal value

System variables:

  • TODAY → today’s date

  • TODAYN → today’s date in decimal format

Examples

TODAYN + 5returns 5 days from today
ID99D → converts a numeric date field into date format

Numbers

Numeric fields can be formatted in text functions.
Use suffix S to format with thousand separators and decimals.

Example

ID987S

Other Suffixes

The suffix S also works with:

  • Dates

  • Dropdown lists

  • Checkboxes

Baseline Values & System Groups

Project Variables (PV)

  • FV → First Value

  • LV → Last Value

  • SV → Selected Value

  • TV → Total Value

  • YV → Yes Value

  • ZV → Zero Value

Examples

ID25FV → first value of field ID25
KA30TV → total value of key attribute KA30

Register Variables

  • ID fields (form fields)

  • KA (Key Attributes)

  • PV (Project Variables)

Operators

Boolean: AND, OR, NOT
Comparison: <, >, <=, >=, =, <>, IN, LIKE
Arithmetic: +, -, *, /, %

Example

(LastName = 'Smith' OR LastName = 'Jones') AND FirstName = 'John'

String Operators

Use + to concatenate strings.

Example

FirstName + ' ' + LastName

Wildcard Characters

Use * or % in LIKE comparisons.
They must be at the start or end of a string.
If * or % appear in a clause, enclose in brackets [].

Examples

ID1 LIKE '*product*' ID1 LIKE '*product' ID1 LIKE 'product*'

Invalid

'te*xt'

System Constraints

System Constraints are rules applied at system level to control values, enforce conditions, or validate inputs across SmartForms and Registers. They help standardize behavior and ensure consistency.

How to use System Constraints in formulas

  • Reference constraints by their ID (like fields and attributes).

  • Apply logical operators (AND, OR, NOT) or conditional functions (IIF) to enforce rules.

  • Use constraints to validate dates, restrict ranges, or enforce required values.

Examples

Restrict a numeric field to positive values

IIF(ID10 < 0, 0, ID10)

Ensure a due date is not earlier than today

IIF(ID50N < TODAYN, TODAY, ID50)

Mark a field mandatory if another field is set

IIF(ID20 = 'Yes' AND ISNULL(ID30, 1) = 1, 'Field required', '')

Validate against project variables

IIF(ID75 > KA10TV, 'Over budget', 'Within budget')

Referencing Fields in Other Groups

Fields from other groups are referenced by their ID codes.
Key Attributes and Project Variables can be combined in formulas.

Baseline suffixes (FV, LV, SV, TV, etc.) help retrieve specific values.

Examples

KA20TV / KA10TV → ratio of totals from two attributes
ID30FV + 100first value of ID30 plus 100

Practical Examples

Days until deadline

ID50N - TODAYN

Completion percentage

(KA25TV / KA10TV) * 100

Formatted budget total

ID75S

Conditional check (wildcard)

ID10 LIKE '*urgent*'

Concatenate project name & code

ProjectName + ' (' + ProjectCode + ')'

Best Practices

  • Always check field ID codes in the form/register setup.

  • Use suffixes consistently (N, D, S, FV, TV, etc.).

  • Test formulas with sample data before applying widely.

  • When working with text, use wildcards carefully (start/end only).


String & Conversion Functions

LEN
Gets the length of a string.

LEN(ID33)

ISNULL
Returns the expression or a replacement value if null.

ISNULL(ID19, -1)

IIF
Inline conditional function.

IIF(ID5 > 1000, 'expensive', 'cheap')

TRIM
Removes leading and trailing spaces.

TRIM(ID20)

SUBSTRING
Gets part of a string starting at a position.

SUBSTRING(ID12, 7, 8)

CONVERT
Converts a value to a specific .NET type (case-sensitive).

IIF(LEN(ID22) = 0, 0, CONVERT(ID22, 'System.Decimal'))

User Attributes

For fields of type User List, you can access attributes of the selected user.

Examples

Parent(ID666).FirstName + ' ' + Parent(ID666).Surname
IIF(Parent(ID666).ImageExists, '<img style="max-width:100px; max-height:100px" src="' + Parent(ID666).ImageFile + '"/>', 'no image available')

Available Attributes

  • UserID

  • UserName

  • FirstName

  • Surname

  • Title

  • Nickname

  • EmailAddress

  • PhoneNumber

  • Mobile

  • Inactive

  • Administrator

  • FullUser

  • ResourceOnly

  • ImageExists

  • ImageFile

  • ExternalLink1–5


Dropdown Lists

For fields of type Dropdown List, you can access attributes of the selected item.

Example

'You chose: ' + Parent(ID333).Description

Available Attributes

  • Description → text of selected item

  • Value → numeric value (same as field reference)

  • Image → image path for selected item

  • Color → HTML color value (e.g., #FF2020)

Cascading Dropdowns
If the list is cascading, use P followed by levels to reference a parent.

Example

ID444P2 → parent value two levels up

Practical Examples

Parent(ID333).Description 'Value: ' + ID333 + ' (' + Parent(ID333).Description + ')' '<span style="color:' + Parent(ID333).Color + '">' + Parent(ID333).Description + '</span>' '<img src="' + Parent(ID333).Image + '" style="max-width:100px; max-height:100px"/>'

Milestone Details

For fields of type Milestone Details, you can access attributes for the configured entry.

Example

'Number of late milestones: ' + Parent(ID777).Late

Available Attributes

  • ID → The milestone ID

  • Description → The description of the milestone

  • Total → The number of milestones for the configured type

  • Late → The number of late milestones for the configured type

  • Completed → The number of completed milestones for the configured type

  • NotStarted → The number of milestones not yet started

  • OnTrack → The number of milestones started but not late

  • LatePercentage → Percentage of milestones that are late

  • CompletedPercentage → Percentage of milestones completed

  • NotStartedPercentage → Percentage of milestones not started

  • OnTrackPercentage → Percentage of milestones on track




Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article