nerdexam
Microsoft

PL-500 · Question #37

You are developing a desktop flow. You need to include an IF statement that contains AND logic within the flow. Which expression should you use for the IF statement?

The correct answer is C. IF $'''%IsEmpty(Variable1)% AND %IsEmpty(Variable2)% ''' = $'''True'''. For an IF statement in a Power Automate for desktop flow requiring AND logic, variables and functions must be correctly referenced within string expressions for proper evaluation.

Develop automations

Question

You are developing a desktop flow. You need to include an IF statement that contains AND logic within the flow. Which expression should you use for the IF statement?

Options

  • AIF (IsEmpty(Variable1) AND IsEmpty(Variable2)) = $'''True'''
  • BIF IsEmpty(IsEmpty(Variable1) AND IsEmpty(Variable2))
  • CIF $'''%IsEmpty(Variable1)% AND %IsEmpty(Variable2)% ''' = $'''True'''
  • DIF (IsEmpty(Variable1) OR IsEmpty(Variable2)) = $'''True'''

How the community answered

(52 responses)
  • A
    10% (5)
  • B
    6% (3)
  • C
    83% (43)
  • D
    2% (1)

Why each option

For an IF statement in a Power Automate for desktop flow requiring AND logic, variables and functions must be correctly referenced within string expressions for proper evaluation.

AIF (IsEmpty(Variable1) AND IsEmpty(Variable2)) = $'''True'''

This syntax uses parentheses directly without wrapping the function calls in percent signs, which is generally not the correct way to evaluate expressions with functions and logical operators within a string context in Power Automate for desktop IF statements.

BIF IsEmpty(IsEmpty(Variable1) AND IsEmpty(Variable2))

This expression incorrectly applies `IsEmpty()` to the result of a boolean `AND` operation, which is not a valid usage, as `IsEmpty()` expects a variable or value, not a boolean.

CIF $'''%IsEmpty(Variable1)% AND %IsEmpty(Variable2)% ''' = $'''True'''Correct

In Power Automate for desktop, variables and functions within expressions often need to be wrapped in percent signs (`%`) when embedded in string literals for correct evaluation, and the `AND` operator is used for logical conjunction. The entire evaluated expression is then compared to `$'''True'''`.

DIF (IsEmpty(Variable1) OR IsEmpty(Variable2)) = $'''True'''

This expression uses `OR` logic instead of the required `AND` logic, which would result in a different conditional evaluation.

Concept tested: Desktop flow conditional logic and expression syntax

Source: https://learn.microsoft.com/power-automate/desktop-flows-variables-expressions

Topics

#Power Automate Desktop expressions#Conditional logic#IsEmpty function#String interpolation

Community Discussion

No community discussion yet for this question.

Full PL-500 Practice