Share via

Microsoft Foundry Workflow if/else statement doesn't allow me to save formula within if statement no matter what

Abanes, Cameron A 20 Reputation points
2026-06-09T21:09:34.7+00:00

I am currently working on an agentic workflow for my agents. I use another agent to output JSON and then a parse value node to parse that to different variables. I have checked that these variables save and output appropriately using a send message node. However, when I try to implement an if/else statement the if statement does not allow me to save any condition logic. No matter what I put in, once I click done it disappears and returns back to the default value. I am simply trying to see if one of the booleans is false.

I have tried "=Local.orchestrationOutput.decision.within_scope", "Local.orchestrationOutput.decision.within_scope = true", "={Local.orchestrationOutput.decision.within_scope}" and every other combo, and it won't even let me save the conditional logic.

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Siddhesh Desai 7,400 Reputation points Microsoft External Staff Moderator
    2026-06-10T07:06:03.41+00:00

    Hi @Abanes, Cameron A

    Thank you for reaching out to Microsoft Q&A.

    The issue you are encountering occurs because Microsoft Foundry workflows use Power Fx expressions (Excel-like syntax) for conditional logic, and the If/Else node strictly validates whether the expression evaluates to a Boolean value. If the syntax is incorrect, the variable type is not properly recognized, or the expression does not resolve to a true/false value, the workflow editor silently resets the condition to default. Additionally, in many cases when working with JSON outputs and Parse Value nodes, the variables are treated as loosely typed (often strings instead of Boolean), which causes the condition validation to fail. Since Foundry workflows are currently in preview, the UI does not show explicit errors and simply removes invalid expressions, which is why your condition disappears after clicking Done.

    Refer below points to resolve this issue or this is the workaround

    Use correct Power Fx syntax for condition

    Ensure the condition starts with = and uses valid Power Fx syntax:

    =Local.orchestrationOutput.decision.within_scope
    

    or

    =Local.orchestrationOutput.decision.within_scope = true
    

    Ensure the variable is Boolean

    If your JSON output contains values like "true" or "false" (as strings), the condition will not work. Convert it explicitly:

    =Lower(Local.orchestrationOutput.decision.within_scope) = "true"
    

    or

    =Boolean(Local.orchestrationOutput.decision.within_scope)
    

    Define proper schema in Parse Value node

    Make sure the Parse Value node defines the Boolean type explicitly; otherwise, the editor treats the value as untyped:

    valueType:
      kind: Record
      properties:
        decision:
          kind: Record
          properties:
            within_scope: Boolean
    

    Validate variable value before If/Else (debug step)

    Add a Send Message node before the condition to confirm the value and type:

    {Text(Local.orchestrationOutput.decision.within_scope)}
    

    Handle preview limitation / UI issue

    Since Foundry workflows are still in preview, the editor may silently drop even valid expressions. If the issue persists after fixing syntax and types, recreate the If/Else node or re-save the workflow to ensure the condition is retained.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.