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 Apps / how to use IF conditio...
Power Apps
Answered

how to use IF condition in PowerApps ..?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi 

always if true condtion is executing but not else part what is the wrong here 

but no error/warning in form.

If(IsBlank(flag1.text) && IsBlank(flag2.Text) && IsBlank(flag3.Text),Set(flag1,"Approved");SubmitForm(UserApproveForm_SP),
If(flag1.text="Approved"&& IsBlank(flag2.Text) && IsBlank(flag3.Text),Set(flag2,"Approved");
SubmitForm(UserApproveForm_SP)));

here till here it was in true part  if you observer from the above code: If(IsBlank(flag1.text) && IsBlank(flag2.Text) && IsBlank(flag3.Text),Set(flag1,"Approved");SubmitForm(UserApproveForm_SP)

updating flag1 value fine but after that second stage it has to excute else part but not excuting.

always even if falg1 value is approved.

 

else_value part is (which is not executing)

If(!(TextInput1.Text="") && IsBlank(DataCardValue2.Text) && IsBlank(DataCardValue1.Text), Set(secondapp,"Approved");
SubmitForm(UserApproveForm_SP)))

 

 

Inshortly: I have 3 flag columns in SP List

 

Initially i have to check all the 3flag columns are blank or not

if yes(3 flag columns are blank)

Update/set flag1 with approved

Next stage 

if flag1 is approved and flag2,3 are empty then

Update/Set flag2 with approved 

if flag1,2 are approved and flag3 is empty

then Update flag3 with approved

 

kinldy correct, and share.

 

Appriticated for your reply.

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    The right syntax of If statement shoule be like:

    If(condition1,result1,

       condition2,result2,

       condition3,result3)

    So beased on your description, try this formula:

    If(IsBlank(flag1.Text) && IsBlank(flag2.Text) && IsBlank(flag3.Text),Set(flag1,"Approved"),
    flag1.Text="Approved"&& IsBlank(flag2.Text) && IsBlank(flag3.Text),Set(flag2,"Approved"),
    flag1.Text="Approved"&& flag2.Text="Approved" && IsBlank(flag3.Text),Set(flag3,"Approved"));
    SubmitForm(UserApproveForm_SP)

     Here's a doc about if statement for your reference:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-if

     

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    working but values are not loading during form submitting.

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard