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 :
Power Platform Community / Forums / Power Automate / If(empty) expression w...
Power Automate
Answered

If(empty) expression with three possible outcomes?

(0) ShareShare
ReportReport
Posted on by 23

Hi.

 

I'm working on a flow that sends an email as a result of a form being submitted.

 

There are two optional questions on the form. Users can choose to ignore both questions, or they can answer one, but they will never answer two.

 

I have tried to write an if(empty) expression that does the following:

  1. Check whether question 1 was answered. If so, display the answer. If not, proceed to step two.
  2. Check whether question 2 was answered. If so, display the answer. If not, proceed to step two.
  3. Display "Neither question has been answered."

 

Here is the expression that I wrote (not working and obviously not the exact expression):

if(empty(question 1 dynamic content), if(empty(question 2 dynamic content), '[Neither question has been answered]', question 2 dynamic content))

 

Here is the error I'm receiving:

Unable to process template language expressions in action 'Send_an_email_(V2)' inputs at line '0' and column '0': 'The template language function 'if' expects three parameter: the condition to test as the first parameter, the value to return if the condition is true as the second parameter, and the value to return if the condition is false as the third parameter. The function was invoked with '2' parameter(s). Please see https://aka.ms/logicexpressions#if for usage details.'.

Categories:
I have the same question (0)
  • AfonsoTanida Profile Picture
    148 on at

    if(not(empty({question1dynamic},{answer1dynamic},if(not(empty({question2dynamic},{answer2dynamic},{Neither question has been answered})))

     

    parenthesis may be off but honestly I can barely count without my glasses

  • Verified answer
    Matthy79 Profile Picture
    4,188 Super User 2024 Season 1 on at

    Hello @Michael291 

     

    in your expression you missed the first valueIfValse. It has to be:

     

    if(empty(question 1 dynamic content), if(empty(question 2 dynamic content), '[Neither question has been answered]', question 2 dynamic content), question 1 dynamic content)

     

    I don't know what the input is but maybe you could also use this:

     

    coalesce(question1, question2, 'Neither question has been answered.')

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 639

#2
Valantis Profile Picture

Valantis 392

#3
11manish Profile Picture

11manish 350

Last 30 days Overall leaderboard