Hi,
I am sending a collection via JSON from PowerApps to PowerAutomate and then to an SQL procedure. Everything is working correctly except that for all datetime fields that I send, PowerAutomate is adding 5 hours. The data is correct in the collection and then when I check the JSON in PowerAutomate it has added 5 hours. Anyone have an idea why that might be happening?
Flow reads all times as UTC times, therefore you need to convert these to your local time. I tend to used the addHours() function but there's also the 'Convert Time' function that you can use as well.
The other option is to adjust your times before they go to Flow inside PowerApps using the DateAdd() function.
Okay I was not aware of that. I have been trying to figure out the best way to overcome this. In my solution I store a collection as a variable in Powerapps, pass that JSON to PowerAutomate and then send the JSON to an SQL stored procedure. Is there a way to do the conversion while keeping it in JSON format? I cant think of a way.
You could try removing 5hrs from your dates in your collection before converting to JSON, like this?
UpdateIf(
yourCollection,
true, // true here Updates all records in the collection
{
Date: DateAdd( ThisRecord.Date, -5, Hours)
// Add extra fields here as needed
}
)
This is more of a workaround I guess but should work. There's probably a 'nicer' way to do this in Flow but I cannot think of it at the moment
User | Count |
---|---|
121 | |
88 | |
88 | |
75 | |
66 |
User | Count |
---|---|
215 | |
180 | |
138 | |
96 | |
82 |