Data/Time flow variable dangerous

Mikael Karlsson
Mega Sage

When you store something in a flow date/time variable, it's converted into instance-time!

 

See the example below where i:

  1. First look up one record which i will use as reference for following "look ups"
  2. Use that record's datetime field in a query (it's safely converted into UTC for a correct query)
  3. Save the same datetime "value"/"pill" into a  date/time variable, here we can see that the value is not kept as UTC but converted into server-time.
  4. Using that variable in a lookup will result in a totally different result

 

This can cause issues for delta sync designs etc, either causing overlaps or gaps in the data.

 

MikaelKarlsson_0-1780650714183.png

 

3 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron

@Mikael Karlsson 

it's a known behavior

see past discussions

Flow Designer: how to use Date/Time Data Transform when not in UTC? 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

@Mikael Karlsson 

workaround is to create custom flow action and handle this

How to check date is greater than 24 hours in flow desinger from catalog variable  -> response from @Hayo Lubbers 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

Tanushree Maiti
Tera Patron

Hi @Mikael Karlsson 

 

This is a well-known Flow Designer nuance: Record Lookup queries automatically treat Date/Time pills as UTC, but when the same value is stored in a Flow Variable or string, it is rendered using the instance/server time zone.

 

You can find several  posts on this topic in the community.

 

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron

@Mikael Karlsson 

it's a known behavior

see past discussions

Flow Designer: how to use Date/Time Data Transform when not in UTC? 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

@Mikael Karlsson 

workaround is to create custom flow action and handle this

How to check date is greater than 24 hours in flow desinger from catalog variable  -> response from @Hayo Lubbers 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Tanushree Maiti
Tera Patron

Hi @Mikael Karlsson 

 

This is a well-known Flow Designer nuance: Record Lookup queries automatically treat Date/Time pills as UTC, but when the same value is stored in a Flow Variable or string, it is rendered using the instance/server time zone.

 

You can find several  posts on this topic in the community.

 

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti