Skip to content
Omniscript

How to use date time input in omniscript salesforce?

September 24, 2025

In this tutorial, we’ll walk through a powerful OmniScript use case where we manage Date and Date/Time inputs in omniscript salesforce, convert them across multiple time zones, and dynamically set default dates, min dates, and max dates.

We’ll also see how to properly display the selected dates from the running User’s Local time zone to Australia, Paris, and the User’s Current time zone.

Use Case: Scheduling a Service Appointment

Imagine a customer booking a broadband installation through your self-service portal built with OmniScript. The customer needs to pick:

  • Preferred Installation Date (If only Date is required)
  • Preferred Installation Date Time Slot (Date/Time input)

In this scenario, we will:

  1. Let the user select the date and time.
  2. Convert the time to Australia/Sydney, Europe/Paris, and the User’s Current time zone.
  3. Display the converted date and time in real-time.

Also Read: Import & Export Omniscripts in New Designer

Step 1: Set Up Date and Date/Time Inputs

In Step 1 of the OmniScript, we start with two critical fields: the Date field and the Date/Time field.

Date Field Configuration

  1. Default Date: Set the default date to Today so that it pre-fills the current date for the user.
  2. Start Date: Restrict the user from selecting any past date by setting the min date to Today.
  3. End Date: Allow the user to select a future date up to 1 year ahead by setting the max date to Today + 1 year.

Example:

  • Default = Today
  • Min Date = Today
  • Max Date = Today + 1 year
Date Field Configuration

Date/Time Field Configuration

For the Date/Time field, we allow the user to pick both the date and the time. The local time zone will be used to adjust the time based on the user’s browser or Salesforce settings.

Date/Time Field Configuration

Step 2: Handling Time Zone Conversion with DataRaptor

Once the user selects the date and time, we capture this value in a Set Values element and store it in the variable setDateTime. By default, this value is saved in UTC.

We then use DataRaptor to transform this UTC time into three different time zones:

  1. Australia/Sydney
  2. Europe/Paris
  3. User’s Current Time Zone

DataRaptor Formula for Time Zone Conversion

To convert the stored UTC time into these time zones, we use the following formulas:Australia/Sydney:

DataRaptor Formula for Time Zone Conversion
%FORMATDATETIME(%setDateTime%,"yyyy-MM-dd'T'HH:mm:ss.SSSZ","Australia/Sydney")%

Europe/Paris:

Europe/Paris:
%FORMATDATETIME(%setDateTime%,"yyyy-MM-dd'T'HH:mm:ss.SSSZ","Europe/Paris")%

User’s Time Zone (dynamic):

User's Time Zone (dynamic):
%FORMATDATETIME(%setDateTime%,"yyyy-MM-dd'T'HH:mm:ss.SSSZ",%userTimeZone%)%

These formulas will convert the stored UTC time (setDateTime) into each of the respective time zones, ensuring that the time shown to the user is accurate.

These formulas will convert the stored UTC time (setDateTime) into each of the respective time zones, ensuring that the time shown to the user is accurate.

Step 3: Displaying Converted Time Zones

In Step 2 of OmniScript, we display the converted date and time in three fields:

  1. Australia/Sydney Time Zone
  2. Europe/Paris Time Zone
  3. User’s Current Time Zone
Displaying Converted Time Zones

These fields will dynamically update and show the correct date and time based on the user’s selection, and will adjust automatically to their local time zone, the Australian time zone, and the Paris time zone.

Key Points Covered in This Example:

  1. Date and Date/Time Inputs:
    • Setting the default date to Today.
    • Configuring min date and max date to ensure valid date selections.
    • Date/Time fields with local timezone handling.
  2. Time Zone Conversion:
    • Using DataRaptor to convert UTC time into Australia, Paris, and User Time Zones.
    • Dynamically pulling the user’s time zone with %userTimeZone% and passing it into the formula.
  3. Display Converted Values:

Display the converted Australia/Sydney, Europe/Paris, and User Time Zone values in text fields.

Conclusion

This simple yet powerful solution in OmniScript allows you to capture, convert, and display time values across different time zones—from a local time picker to globalized date and time handling. By leveraging DataRaptor formulas and Set Values, you can ensure users get the correct date and time representation, no matter where they are in the world.where they are in the world.

Keep Reading

Related Articles and Resources

Major Components of the Vlocity Product Catalog (VPC) in Salesforce Industries CPQ
July 10, 2025

Major Components of the Vlocity Product Catalog (VPC) in Salesforce Industries CPQ

In the evolving landscape of B2B and B2C commerce,...

Salesforce Revenue Cloud Qualification Rules
September 27, 2025

Salesforce Revenue Cloud Qualification Rules

In this post, we take a look at what Salesforce revenue...

The Three-Part Pricing Problem: Why Your Context Definitions, Pricing Procedures, and Decision Tables Aren’t Playing Nice Together
January 6, 2026

The Three-Part Pricing Problem: Why Your Context Definitions, Pricing Procedures, and Decision Tables Aren’t Playing Nice Together

The Problem That Starts Small and Explodes Here’s...

Ultimate Salesforce Agentforce Guide: Your Complete Expert Resource
October 11, 2025

Ultimate Salesforce Agentforce Guide: Your Complete Expert Resource

Salesforce Agentforce marks the next big leap in AI,...

Free Salesforce Training Classes Await to Kickstart Your Career
October 7, 2025

Free Salesforce Training Classes Await to Kickstart Your Career

Ever sat through a glitzy online course and thought, “Is...

How to Pass List/Obj to Integration Procedure from FlexCard?
November 10, 2024

How to Pass List/Obj to Integration Procedure from FlexCard?

Passing Input to a Integration Procedure, the syntax is...