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 / Check field is filled ...
Power Apps
Answered

Check field is filled before update the data in SQL Database

(1) ShareShare
ReportReport
Posted on by 73

If((!IsEmpty(Dropdown14.SelectedText.Value)||!IsBlank(Dropdown14.SelectedText.Value))&&(!IsEmpty(DataCardValue8)||!IsBlank(DataCardValue8)),(Patch('[dbo].[Sample]',
LookUp( '[dbo].[Sample]', sample_no = DataCardValue1.Text), {status: "Pass",condition:Dropdown14.SelectedText.Value,mark: DataCardValue8.Text})),NotificationType.Error);

 

I put this function in the OnSelect function of my update button, but it seem it will still update the data in SQL database even through the dropdown14 and datacardvalue8 is blank.

How I do it so it will prompt error notification if any one of the field is not filled by user?

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,312 Most Valuable Professional on at

    Hi @NeohLooi ,

    I think you can simplify it to the below - it should work

    If(
     IsBlank(Dropdown14.Selected.Value) ||
     IsBlank(DataCardValue8.Text),
     Notify("Complete required fields",NotificationType.Error),
     Patch(
     '[dbo].[Sample]',
     {sample_no:DataCardValue1.Text},
     {
     status: "Pass",
     condition:Dropdown14.SelectedText.Value,
     mark: DataCardValue8.Text
     }
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Verified answer
    poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @NeohLooi 

     

    We can reproduce this problem if you use IsEmpty on a Value  - IsEmpty is used on a Table not a Value - if you use isEmpty on a Value the way you are doing, it will not behave as you want.

     

    Instead of !IsEmpty(Dropdown14.SelectedText.Value)

    you should use

     

     

    !IsBlank(Dropdown14.SelectedText.Value)

     

     

    You must also correct everywhere else you use it incorrectly as !IsEmpty(Something.SelectedText.Value)  to !IsBlank(Something.SelectedText.Value) as well.

     

    Check a full working example versus a full non-working example comparison below:

     

    EmptyApp9.gif

     

     

     

     

    Check sample App attached to this post : EmptyApp9-v1.msapp to play with this above app on your own as well if you want.

     

    How to import attached msapp to your environment to play with it:

     

    First, save the attached msapp EmptyApp9-v1.msapp to local computer - then:

     

    1.  Navigate with your browser manually to this URL (or just click the following link): https://us.create.powerapps.com/studio/
    2.  Then, Click "Open" on the left side
    3.  Next, Click "Browse" on the right side
    4. Finally, select the msapp file from the window when prompted.
    5. Done

    Check if above helps you @NeohLooi .

     

    Additional Reference:

    Blank, Coalesce, IsBlank, and IsEmpty functions in Power Apps

    Syntax

    Blank()

    Coalesce( Value1 [, Value2, ... ] )

    • Value(s) – Required. Values to test. Each value is evaluated in order until a value that is not blank and not an empty string is found. Values after this point are not evaluated.

    IsBlank( Value )

    • Value – Required. Value to test for a blank value or empty string.

    IsEmpty( Table )

    • Table - Required. Table to test for records.


     

  • WarrenBelz Profile Picture
    156,312 Most Valuable Professional on at

    @NeohLooi ,

    @poweractivate is correct which is why I removed IsEmpty. Also SelectedText is deprecated, so you should use .Selected.

  • WarrenBelz Profile Picture
    156,312 Most Valuable Professional on at

    Hi @NeohLooi ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it 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

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 377 Most Valuable Professional

#2
11manish Profile Picture

11manish 165 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 110 Super User 2026 Season 2

Last 30 days Overall leaderboard