Feb 27, 2022 2 min read

Dataverse Trigger and Action in Power Automate return different values for Date Only columns

Power Automate trigger and action for Dataverse return a different value for a Date Only (with User Local behavior) column.

Dataverse Trigger and Action in Power Automate return different values for Date Only columns

This week I noticed a behavioural difference between the Dataverse When a row is added, modified or deleted trigger and Get a row by ID action in Power Automate, specifically with Date Only columns. I had this experience with the msdyn_date column in the Time Entry table and the transactiondate column in the Expense table, both who are configured as Date Only with the User Local behavior.

When you use the trigger in a Power Automate flow, the flow will start when a row is created, modified or deleted in the Time Entry table in Dataverse and it will receive all the data for that specific row. The value for the msdyn_date column is returned as 2022-02-20 for me:

  "msdyn_date": "2022-02-20"

On the other hand, if you use the Get row by ID action to fetch the exact same row from the Time Entries table it will return the value for the msdyn_column as 2022-02-20T23:00:00Z:

  "msdyn_date@OData.Community.Display.V1.FormattedValue": "21/02/2022",
  "msdyn_date@odata.type": "#DateTimeOffset",
  "msdyn_date": "2022-02-20T23:00:00Z"

As you can see, the format returned by the Trigger is also returned by the Action but only in the msdyn_date@ODate.Community.Display.V1.FormattedValue property. According to the documentation, this type of column would return the UTC value of the stored date but apparently the Trigger only returns the date part 🤷‍♂️. Another thing to take notice of: the trigger provides "just" the date part but doesn't adjust for timezone while the actions FormattedValue does!
I have no explanation on why both behave differently like this (feels like a bug...), but it's good to know quirks like this for future reference 😉.

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to Yannick Reekmans.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.