Weird issue with inserting dynamic data into email

So, I have a pretty simple workflow setup here. When a user creates a new appointment, I would like to remind all participants of said appointment. So I send a email out that pulls data from the appointment “thing” it looks like this:

New Appointment Scheduled!

Client: (Inserts Client Name)

Trainer: (Inserts Trainer name)

Time: (Inserts appointment start time)

The first two are perfect, but on the last one it inserts a seemingly random time, I have no idea where its getting these numbers. I might schedule an appointment for 5PM, but in the email it’ll say 1AM. The times I get do not correlate with any data field that I can find.

Could there be a time zone issue somewhere?

That would be my guess too. Bubble now seems to try to localise times - so maybe the server time is 1am when your timezone is 5pm.

@NigelG @pnodseth, I thought that could be a possibility as well. But, the field it’s pulling from has the correct time, so why would it matter, isn’t it just pasting data from my “appointment” thing?

@emmanuel, what are your thoughts?

Yes it’s because the time is calculated on the server. What you can do is save the time as a formatted string, because then the evaluation happens on the client, so it’s consistent with what the user sees.

Gotcha. The date input must be stored as a date not text. So I should create a new field to store it as an text as well?

@emmanuel, Heres what I tried:

  1. A new appointment is created.
    the “start time” is based off a date/time input element and stored as a date value
  2. A change is made to the appointment:
    A new text field “display time” is created
    “display time” is equal to the value of “start time” but as a formatted string
  3. An email is sent
    time in email is equal to “display time”

I get the same issue, what am I missing?

Sorry I could have been more clear. Here is the hack

we’ll probably try to come up with a better solution this month.

1 Like

Hi Emmanuel,

Any update with this? I’m still getting the same error - the email time zone is 5 hours ahead.