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 / If drop down = x and d...
Power Apps
Answered

If drop down = x and date is blank then notify else save

(0) ShareShare
ReportReport
Posted on by 72

Hello,

 

I'm trying to validate the form inputting before saving and the = sign in the if condition part of the statement is showing an error.  I've tried evaluating the selected text and the value of the selected text, but can't seem to get the syntax correct. 

 

For example (these both do not work):

 

(drpGoalStatusKey.SelectedText = "Achieved" || drpGoalStatusKey.SelectedText = "Not Achieved") && IsBlank(dteGoalEndDate)

 

(drpGoalStatusKey.Selected = 3 || drpGoalStatusKey.Selected = 4) && IsBlank(dteGoalEndDate)

 

If((drpGoalStatusKey.SelectedText = "Achieved" || drpGoalStatusKey.SelectedText = "Not Achieved") && IsBlank(dteGoalEndDate)
 , Notify("Save cancelled because end date should not be blank if status is achieved or not achieved.")
 , SubmitForm(frmGoals);
 );

 

Could someone please help me correct this?

 

Thanks,

J

Categories:
I have the same question (0)
  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Hi @BPNJMC1 ,

     

    Would you please share the items property shared with the dropdown. If it is collection dropdown.selected.columnname should else dropdown.selected.text should work.

  • BPNJMC1 Profile Picture
    72 on at

    Hi @PriyankaGeethik,

     

    The source for the drop down is an Azure SQL table.

     

    BPNJMC1_2-1627917797730.png

     

    BPNJMC1_1-1627917705225.png

    Thanks,

    J

     

     

  • Verified answer
    PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Hi @BPNJMC1 ,

     

    Would you mind trying below code.

     

    If((drpGoalStatusKey.Selected.GoalStatusName = "Achieved" || drpGoalStatusKey.Selected.GoalStatusName = "Not Achieved") && IsBlank(dteGoalEndDate)
     , Notify("Save cancelled because end date should not be blank if status is achieved or not achieved.")
     , SubmitForm(frmGoals);
     );

     

    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.

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    IsBlank(date) returns true or false, so you need to insert something like:


    (drpGoalStatusKey.SelectedText = "Achieved" || drpGoalStatusKey.SelectedText = "Not Achieved") && IsBlank(dteGoalEndDate) = true,

    Notify("");

    SubmitForm(Form1)

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    And maybe, you need to do sometihng like:

     

    drpGoalStatusKey.Selected.value = "Achieved"

  • BPNJMC1 Profile Picture
    72 on at

    @PriyankaGeethik ,

     

    That worked!  Thank you so much!

     

    J

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

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard