Date

The Date function returns the current system date dynamically when it is executed. It is typically used when you need to work with or store the present day’s date in your application logic.

When to Use

  • Get Today’s Date: Use this function when you need to capture or reference the current date dynamically.
  • Automate Time-Based Logic: Apply this function when creating logic that depends on the present date (e.g., validations, comparisons, expiry checks).
  • Default Date Field Values: Use it to auto-fill form fields with today’s date during onboarding or data entry.

Common Use Cases

  • To fill the “Application Date” field when a user submits a form.
  • To fetch and display the date dynamically or statically

Concept

You will typically use the function within the Smart Selector, which has various function tabs. By typing “Date” in the search bar, you can select it and define its parameters.

Parameter:

Arg (Argument)It is a string format from here you can fetch the date in string format from the entity.

Since this function can be applied across multiple scenarios to show year difference from the current year, we’ll walk through one specific example below:

Scenario: Display the last login date dynamically in a text element for the form.

Pre-Requisite:

  • Basic Understanding of Tasks and Entity.
  • Following elements:
ElementsReference NameDescription
RowRow_46299_DateFunctionRow is a layout element to put two components next to each other in a row
TextText_57409_lastlogindatelabelIn the first text element, a static string value ‘Last Login Date‘ as a label will be shown.
TextText_55311_lastlogindateIn the second text element, the dynamically fetched date will be shown.

You have to do two steps:

  1. Create an Entity
  2. Create a Task Group

Create an Entity

Create an entity that stores the last login date of the user:

Create a Task Group

  1. Create a Task Group named “Date“.
  2. Drag a copy data task and do the following:
Copy From1. Select the Date function
2. Under the arg parameter, find and select the entity LastLoginDate.
Copy ToSelect the element Text_55311_lastlogindate.
  1. Reload the element with reference name Text_55311_lastlogindate.

Link Element and Task

Linking the task to the element through an event is crucial to display the date in the text element.

  1. Select Last Login Date (with reference name Text_57409_lastlogindatelabel):
  2. On the bottom section of the right panel, locate Events ().
  3. In the event section (), onClick event appears.
  4. Click the plus sign () adjacent to onClick.
  5. The event configuration opens. Drag the Date Task to the execution panel.
  1. Click the Save button located on the bottom right.

Result

When a user clicks the “Last Login Date” label, the system fetches and displays the current date in the associated text field (Text_55311_lastlogindate), using the Date function.

Best Practices

  • Use the Date function to fetch today’s date only when you really need the current date at runtime.
  • Set a consistent date format (like YYYY-MM-DD) to avoid confusion or errors.
  • Store the date in an entity if it will be used later in business rules or tasks.
  • Avoid using the Date function multiple times unnecessarily—fetch once and reuse the value.
  • Test your logic with real-time date changes to ensure expected behavior.
Was this article helpful?
YesNo