I use the "Get Records" element to retrieve an object and select "Choose fields and let Salesforce do the rest" to save a field of type Time on this record. (I've tried "Choose fields and assign variables (advanced)" as well - saving the time field into a text variable. The flow can be saved, but produces an "Unfortunately, there was a problem. Please try again..." and can't even be debugged.)
Based on this time, I would like to overwrite the time part of a DateTime field of another record. DateTimes can be adjusted with texts, e.g. by
DATETIMEVALUE(TEXT(DATEVALUE({!Start_Date_1})) & " 22:22:22")
(I'm aware of the dangers of time zones in this context.)
But how can I convert the Time field to a text? The formula
TEXT(MyTime__c)
works as a definition of a formula field of an object and returns something like 08:00:00.000. Trying to save a similar formula in a flow
"My time "&TEXT({!Get_My_Time.MyTime__c})
, Salesforce has an issue:
The formula expression is invalid: Incorrect parameter type for function 'TEXT()'. Expected Number, Date, DateTime, Picklist, received Text
Indeed I can store times as texts in text formulas without an issue:
"My time "&{!Get_My_Time.MyTime__c}
But according to the flow debugger, this returns null throughout.
So is the workaround to use the formula field on the object and refer to this in the flow? Or what have I missed?