web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Power Automate Help

(3) ShareShare
ReportReport
Posted on by 6
Hello,

I am having an issue with Power Automate. When an opportunity in D365 is closed as won, I want a Project record to automatically be created, Project is a custom entity. The flow runs successfully, however when I check the raw outputs for the run history all the components seem to capture that the opportunity has been won, I have verified this as I see statuscode = 3 (being the Status Reason field in D365). I have also tried using statecode (Status) where 1 is the equivalent of WON.

However, the final Condition component is constantly being skipped, the data output gives a false result "expressionResult": false. Every component before the condition including the trigger captures the statuscode as 3 so the flow is working as it should do. I have tried many different expressions to get the condition to work, I have even tried converting the status code to a string just in case this was causing the issue using the formula string(triggerOutputs()?['body/statuscode']) followed by: is equal to, followed by ‘3’.

Can anybody help with the formula to get the statuscode to be recognised in the Condition. FYI, I have included the Compose component before the Condition and it is as expected, the data output for it is 3, so this indicates that the trigger is working correctly.

Thank you
I have the same question (0)
  • Suggested answer
    Holly Huffman Profile Picture
    6,554 Super User 2026 Season 1 on at
    Hi there! Good morning, evening, or afternoon - depending on where you are :) Hope you are well today! 
     
    It sounds like you're really close! Based on details you provided, might be HOW the condition is evaluating statuscode. 
    Even though your Compose component confirms statuscode = 3, the condition might not be recognizing it properly due to data type mismatches. When you use the formula (triggerOutputs()?['body/statuscode']) to convert it to a string, make sure you're also comparing it to the correct string representation.
     
    For instance: 
     
    • Simplify the Condition Expression: Update the expression in the Condition component to:
      • equals(string(triggerOutputs()?['body/statuscode']), '3')
    • Ensure Case Consistency: Power Automate is case-sensitive. Double-check that you're using consistent capitalization in your strings
    • Check for Extra Spaces: Ensure that there are no leading or trailing spaces in either your output value or the value you're comparing it to. A quick way to handle this is to use the trim() function:
      • equals(trim(string(triggerOutputs()?['body/statuscode'])), '3')
    • Debugging with Compose: To further debug, add another Compose component after your initial one and use the same string(triggerOutputs()?['body/statuscode']) formula. Confirm that the output matches the expected '3' string
    • Inspect JSON Outputs: Sometimes, the raw JSON data includes unexpected characters. Review the raw outputs of your trigger or Compose components to ensure the statuscode isn't being returned in a format you didn't anticipate (e.g., as part of an array or object)
     
    hope this helps some! 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Subra Profile Picture

Subra 115

#2
11manish Profile Picture

11manish 87

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 83 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans