# Formula

### Overview

The following outlines the key formula expressions available on the platform:

***

1. **`CURRENT USER`**\
   Returns the name of the currently logged-in user. Useful for tracking user actions, such as who updated a record or submitted a form.
2. **`TODAY`**\
   Provides the current date without the time component. It automatically populates date fields, saving time and ensuring accuracy in tasks or logs.
3. **`NOW`**\
   Returns both the current date and time. Ideal for timestamping events or tracking real-time actions.
4. **`if ... else ...`**\
   Enables conditional logic, returning different values based on whether a condition is true or false. It’s used for decision-making within formulas.
5. **`or`**\
   Evaluates multiple conditions, returning true if at least one is true. Useful when any one condition can trigger an action.
6. **`and`**\
   Evaluates multiple conditions, returning true only if all conditions are true. Ensures that all criteria are met for actions like approvals.
7. **`sum (list / table)`**\
   Calculates the total of values in a list or table. Helps automate the summing of sales, expenses, or scores.
8. **`Row Auto Number` (Only for From Table Formula)**\
   Automatically assigns a serial number to rows in a table, helping organize and index data without manual entry.

***

### Expression Usage

Below is a detailed overview of how each formula expression is utilized, with practical coding examples and specific use cases to guide implementation in workflows:

***

<table><thead><tr><th width="212">Expression</th><th>Example</th><th>Use Case</th></tr></thead><tbody><tr><td>CURRENT USER</td><td>CURRENT USER</td><td>Identifying who submitted or updated a specific record.</td></tr><tr><td>TODAY</td><td>TODAY</td><td>Automatically populating date fields for tasks or logs.</td></tr><tr><td>NOW</td><td>NOW</td><td>Adding a real-time timestamp to events or actions.</td></tr><tr><td>if... else...</td><td>if Form's Calculation 2's Test Case Code .ToString() is "" else ( Form's Calculation 2's Unit Price * Form's Calculation 2's QTY)</td><td>Test if the formula returns <code>""</code> when Test Case Code is empty or calculates Unit Price × QTY in Calculation 2 otherwise.</td></tr><tr><td>or</td><td>Form's Platform or Form's Module</td><td>Test whether the formula correctly returns true if either the <code>Platform</code> <strong>or</strong> <code>Module</code> field has a valid value.</td></tr><tr><td>and</td><td>filter(Form's Table's Yes No and Form's Table's Attachment )</td><td>Test whether the formula successfully filters table rows based on two conditions: <code>Yes No</code> must be <code>Yes</code>, <strong>and</strong> <code>Attachment</code> must not be empty.</td></tr><tr><td>sum (list / table)</td><td>sum(#Form's Table's Number2)</td><td>Test whether the formula correctly calculates the <strong>sum</strong> of numeric values in the <code>Number2</code> column of a table.</td></tr><tr><td>Row Auto Number</td><td>Row Auto Number</td><td>Automatically assigning serial numbers to table rows.</td></tr></tbody></table>

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://inistate.gitbook.io/home/advanced/formula.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
