XPath with Date and Time, again

2
I have a table with an attribute, ActivityDate, of type Date and time, not localized. This is a subset of the data collection: My page should extract all the records for a specific day. To achieve this I have a variable called SearchDate (trimmed to Days, so time is 12.00AM). I also defined 2 extra variables: Now, for the funny part: my SearchDate is 12/30/2021 12:00AM, SearchDateLimit_Lo is 12/29/2021 12:00AM, SearchDateLimit_Hi is 12/31/2021 12:00AM. Retrieve Objects action with XPath is defined like this: I get a dataset containing records for both 12/30 and 12/31. If the XPath is defined as [ActivityDate = $IOArray/SearchDate] I do not get any record. Who can suggest the magic? Thanks, Massimo  
asked
2 answers
0

Try using trimToDaysUTC instead of normal trimToDays.

Also, is the attribute SearchDate of entity IOArray non localised as well? I think there is a difference in the time part of those dates and hence you are not getting any results.

answered
0

The DateTime variable you’re using is still localized to your user’s timezone. In your microflow expression, try using the `trimToDaysUTC()` function instead of just `trimToDays()`:

 

You can play with this expression here: https://repl-sandbox.mxapps.io/ 

answered