Skip to main content

Hi everyone,

I'm building an appointment booking system using Salesforce Flow, and I’m struggling with converting time zones properly. Here’s what I need:

My Requirements:

  • I’m using the Event object for appointment scheduling.
  • Users select a date slot from the date field and a user from a picklist
  • system should give me back for this user available time slots 
  • The available time slots should be compared against existing Event records to remove booked slots.
  • The comparison is failing because StartDateTime on the Event object is in UTC, while my time slots are in the user’s local time zone.
  • TimeValue() and Hour() functions do not work in Flow formulas.

Issues I'm Facing:

  1. Time mismatch: When I compare my Looped Time Slots (text-based) against StartDateTime (UTC), they never match.
  2. Time Zone Conversion: I need a way to convert the stored UTC StartDateTime to the user's local time dynamically in Flow.
  3. Formula Issues: I tried extracting the time from StartDateTime using formulas, but TIMEVALUE() and HOUR() are not supported in Flow formulas.

What I’ve Tried:

  • Using TEXT(StartDateTime), but it gives a full date-time string that doesn’t match my predefined time slots.
  • Splitting the date-time string with MID(), VALUE(), and FIND(), but the format is inconsistent.
  • Creating a formula field on the Event object, but Flow still struggles to compare it.

What I Need Help With:

  1. How can I convert StartDateTime from UTC to the user's local time zone in Flow?
  2. What’s the best way to compare a text-based time slot (e.g., "09:00 AM") with StartDateTime?
  3. If Flow isn’t ideal for this, what’s a better approach? A custom field? Apex?

I appreciate any guidance, examples, or alternative approaches! Thanks in advance!   

@* Salesforce Developers * 

2 answers
0/9000