Hi!
I'm having trouble getting a Date field from Excel to be returned in ISO format. While it works in "test" mode, it does not work in live/run mode.
Some backstory: I've created a flow to export data from one of our internal systems via an API, and write the resulting data to an Excel file. The API connector allows me to request data for a specific time period. To ensure I always request the necessary results, even if the flow would have failed once, I start my flow by reading the existing Excel file, getting the highest "Last Updated Date" and using that as the starting date range.
When extracting this data/Date from Excel, something strange is occuring. When I "test" the flow, it all works perfectly. The flow connects to the excel, gets the TOP 1 record, on Last Updated Date descending, and returns it in ISO mode.

The following Compose step gets the first() row from the excel and extracts the date from it, and formats it to the correct format I need.
formatDateTime(
first(outputs('List_rows_present_in_a_table')?['body/value'])['LastUpdatedDate'],
'yyyy-MM-dd hh:mm:ss')
When running this flow in "Test mode", it works perfectly.

Without doing any changes, if I run the same flow on the schedule, or clicking the "Run" button, it fails.


Unable to process template language expressions in action 'First_Date' inputs at line '0' and column '0': 'In function 'formatDateTime', the value provided for date time string '45194.275' was not valid. The datetime string must match ISO 8601 format.'.
And indeed, the returned json from Excel returns the date as a number when in Run mode:

While it returns the date as ISO date in "Test" mode.

Has anyone else had this issue before? Any ideas on how to resolve this?