Skip to main content
Nitalya Thorp (Jacuzzi) 님이 #Formulas에 질문했습니다

Hello, 

 

Im a attempting to use a formula variable in Flow to populate a date/time field by pulling from a date field. 

 

Date Field is called "Taken On Date" 

-Populated Value : 3/28/2023

 

Date/Time Field is called "Latest Taken On Date/Time"

-After Flow is Ran populated: 3/27/2023 5:00 PM

 

Flow Formula Variable 

 

DATETIMEVALUE(Taken_On_Date__c)

 

Is there a way to populate the time that the Taken On Date is populated instead of 5pm the day before? 

답변 2개
  1. Bradley Weller (Fast Slow Motion) Forum Ambassador
    2023년 3월 28일 오후 11:31

    The issue is that taking DATETIMEVALUE from a Date field returns the time at 12:00 AM GMT on that date. I assume your timezone is (GMT -7).

     

    An option you have is to use DATETIMEVALUE and then add the necessary number of hours in order to get to 12:00 AM in your timezone. To add hours to a Date/Time you use  (Date/Time value + (N/24)) with N representing the number of hours. You need to be careful with this though if you have Daylight Savings Time. You may want to give it a buffer of an hour.

     

    Here is an Unofficial SF package that helps to convert Date to Date/Time in a Flow.

     

    https://unofficialsf.com/convert-date-to-datetime-flow-action/

     

    Your "Taken On Date" field only holds the date so there is no way to pull the exact Date/Time out of it. If you need both fields and it is possible, it would be better to have the user or automation populate the Date/Time field originally and then pull the DATEVALUE out of that.

0/9000