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

Notifications

Announcements

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,180 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard