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 / Notification if fields...
Power Apps
Answered

Notification if fields are empty

(0) ShareShare
ReportReport
Posted on by 1,625

Hi,
I need some help please.

I have a save button on a already submitted form, for user2 to enter upto 7 approvers. I wanted the save button to display a notification if User2 attempts to save the form without selecting at least 1 user, I thought this may work, it still present a notification, but still submits the form:

 

If(IsBlank(DataCardValue81.Selected.Email),
If(IsBlank(DataCardValue65.Selected.Email),
If(IsBlank(DataCardValue64.Selected.Email),
If(IsBlank(DataCardValue68.Selected.Email),
If(IsBlank(DataCardValue69.Selected.Email),
If(IsBlank(DataCardValue79.Selected.Email),
If(IsBlank(DataCardValue80.Selected.Email),
Notify("You need to identify at least 1 approver ", NotificationType.Error)
)))))));

SubmitForm(Form1_8);
Office365Outlook.SendEmailV2(Form1_8.LastSubmit........................

 

 

what am i doing wrong please?

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @Lefty 

    The problem was your code contained a nested IF statement where all of the datacards had to be blank to show and error message.  You'll want to take advantage of the OR statement instead.

    If(
     IsBlank(DataCardValue81.Selected.Email)
     Or IsBlank(DataCardValue65.Selected.Email)
     Or IsBlank(DataCardValue64.Selected.Email)
     Or IsBlank(DataCardValue68.Selected.Email)
     Or IsBlank(DataCardValue69.Selected.Email)
     Or IsBlank(DataCardValue79.Selected.Email)
     Or IsBlank(DataCardValue80.Selected.Email),
     Notify("You need to identify at least 1 approver ", NotificationType.Error),
     SubmitForm(Form1_8)
    )
     

     

    And you should also move this code to the OnSuccess property of the form so it will only fire when the form is submitted.

     

    Office365Outlook.SendEmailV2(Form1_8.LastSubmit........................

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Lefty Profile Picture
    1,625 on at

    Hi @mdevaney 

    Thanks for your response and advice, ive moved the send email to OnSucess of the form, please see error in the syntax i'm getting:

     

     

    If Or.PNG

  • mdevaney Profile Picture
    29,991 Moderator on at

    @Lefty 
    Your code does not match mine: there are a bunch of open brackets like this  (  in front of your IsBlank functions.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

     

  • Lefty Profile Picture
    1,625 on at

    HI @mdevaney 

     

    Thanks, that's what i get when I try to modify my existing code

     

    I've now published and checked its published, when I have no users in any of the fields and i click submit i get the notification 👍
    but after i enter a user in 1 field, and i click submit, i still get the notification appear.

     

    If i enter data in all 7 fields i can submit the form.... ideally i need to be able to select just 1 for the notification to not appear and be able to submit the form

  • mdevaney Profile Picture
    29,991 Moderator on at

    @Lefty 

    Did you make the changes to your code?  If yes, can you please take a screenshot?

  • Lefty Profile Picture
    1,625 on at

    hi @mdevaney 

    Yep, Made the changes you pointed out, please see attached:

     

    If Or.PNG

  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @Lefty 

    Ok, I think I misunderstood your original requirements.  Here's my correction.

     

    If(
     !IsBlank(DataCardValue81.Selected.Email)
     Or !IsBlank(DataCardValue65.Selected.Email)
     Or !IsBlank(DataCardValue64.Selected.Email)
     Or !IsBlank(DataCardValue68.Selected.Email)
     Or !IsBlank(DataCardValue69.Selected.Email)
     Or !IsBlank(DataCardValue79.Selected.Email)
     Or !IsBlank(DataCardValue80.Selected.Email),
     SubmitForm(Form1_8),
     Notify("You need to identify at least 1 approver ", NotificationType.Error)
    )

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

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 Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard