Search code examples
power-automatedynamics-365

Dynamics 365 Cloud automation flow http request changetype


I have a cloud automation flow in powerautomate configured. Which is working. When an account is created or updated the flow will make an HTTP request. There are a few properties, but an important one is the ChangeType (created or updated). For simplicity I have switched to a simple http request. This is the IaC:

{
  "type": "Http",
  "inputs": {
    "uri": "https://something-fancy.azurewebsites.net/api/event/client",
    "method": "POST",
    "headers": {
      "content-type": "application/json"
    },
    "body": {
      "AccountId": "@triggerOutputs()?['body/accountid']",
      "ChangeType": "@triggerOutputs()?['body/changeType']",
      "ModifiedValue": "@triggerOutputs()?['body/_modifiedby_value']"
    }
  },
  "runAfter": {},
  "metadata": {
    "operationMetadataId": "f5fefacf-3-91a7-7ac05305e1b8"
  }
}

My problem lies in "ChangeType": "@triggerOutputs()?['body/changeType']", it is ALWAYS NULL in the request. Do I need to select something else?

I know I can create multiple flows, but that seems to defeat the purpose of ChangeType ;)


Solution

  • finally found it out: https://learn.microsoft.com/en-us/power-automate/dataverse/create-update-delete-trigger?tabs=classic-designer

    The trigger condition, Change type, precisely defines which combination of changes to a row would run the flow.
    
    When the flow is triggered by the creation, update, or deletion of a row, the value of triggerOutputs()['body/SdkMessage'] will be Create, Update, or Delete, respectively.```
    
    not sure why Co-pilot is trying to feed me the changeType prop...
    but this one has the expected values.