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 Apps / IF formula to ensure d...
Power Apps
Unanswered

IF formula to ensure data is entered in fields before proceeding

(0) ShareShare
ReportReport
Posted on by

Hi Guys,

 

I have the below code on my OnSelect to not allow the user to proceed to the next screen unless certain fields are filled in. Could you tell me how I can also include that If 'Dropdown-Status' is set to the option Closed then 'Txt-ImmediateCorrection'.Text must have some text in the box and the same for 'Txt-PermanentPreventative so both boxes must have something entered into the box if the status dropdown is set to closed otherwise they can't proceed to the next screen? If the Status dropdown is set to Open then those 2 text boxes don't require to have data? 

 

If(
 'Dropdown-Classification'.Selected.Value = "Please select an option" || 
 'Dropdown-Status'.Selected.Value = "Please select an option" || 
 'Dropdown-Hours'.Selected.Value = "Hour" || 
 'Dropdown-Minutes'.Selected.Value = "Minutes" || 
 'Dropdown-JobSpecific'.Selected.Value = "Please select an option" ||
 'Dropdown-BusinessUnit'.Selected.Value = "Please select an option" || 
 'Dropdown-SourceFunction'.Selected.Result = "Please select an option" || 
 'Dropdown-CauseCategory'.Selected.Title = "Please select an option" || 
 'Dropdown-Source'.Selected.Value = "Please select an option" || 
 'Dropdown-BusinessChange'.Selected.Value = "Please select an option",
 
 Notify("Please fill out all items, anything highlighted in red requires something entering");
 Set(varOnSubmit, true),
 Navigate(Costs,Cover);
 Set(varOnSubmit, false) 
)

 

 

Many Thanks 

Categories:
I have the same question (0)
  • Verified answer
    NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    You can try using below formula 

    If(
     ('Dropdown-Classification'.Selected.Value = "Please select an option" || 
     'Dropdown-Status'.Selected.Value = "Please select an option" || 
     'Dropdown-Hours'.Selected.Value = "Hour" || 
     'Dropdown-Minutes'.Selected.Value = "Minutes" || 
     'Dropdown-JobSpecific'.Selected.Value = "Please select an option" ||
     'Dropdown-BusinessUnit'.Selected.Value = "Please select an option" || 
     'Dropdown-SourceFunction'.Selected.Result = "Please select an option" || 
     'Dropdown-CauseCategory'.Selected.Title = "Please select an option" || 
     'Dropdown-Source'.Selected.Value = "Please select an option" || 
     'Dropdown-BusinessChange'.Selected.Value = "Please select an option") || ('Dropdown-status'.Selected.Value="Closed" && (IsBlank(TextInputName.Text)|| IsBlank(TextInputName.Text)))) ,
     
     Notify("Please fill out all items, anything highlighted in red requires something entering");
     Set(varOnSubmit, true),
     Navigate(Costs,Cover);
     Set(varOnSubmit, false) 
    )

     

  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    Hi,

     

    Try adding this to your If statement:

     

    Dropdown-Status.SelectedText.Value = "Closed" && IsBlank(Txt-PermanentPreventative)

  • Community Power Platform Member Profile Picture
    on at

    In these cases I use the updateContext. So in the OnSelect you mentioned, I would doe something like this:

     

    UpdateContext({boolMeetedStatusReq: If(Dropdown-Status.Selected.Value = "Closed" && !IsBlank(Txt-PermanentPreventative.Text),false,true)});

    If(
    boolMeetedStatusReq ||
    'Dropdown-Classification'.Selected.Value = "Please select an option" ||
    'Dropdown-Status'.Selected.Value = "Please select an option" ||
    'Dropdown-Hours'.Selected.Value = "Hour" ||
    'Dropdown-Minutes'.Selected.Value = "Minutes" ||
    'Dropdown-JobSpecific'.Selected.Value = "Please select an option" ||
    'Dropdown-BusinessUnit'.Selected.Value = "Please select an option" ||
    'Dropdown-SourceFunction'.Selected.Result = "Please select an option" ||
    'Dropdown-CauseCategory'.Selected.Title = "Please select an option" ||
    'Dropdown-Source'.Selected.Value = "Please select an option" ||
    'Dropdown-BusinessChange'.Selected.Value = "Please select an option",

    Notify("Please fill out all items, anything highlighted in red requires something entering");
    Set(varOnSubmit, true),
    Navigate(Costs,Cover);
    Set(varOnSubmit, false)
    )
  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @Dave-ITMan you could just add another logical test

     

    If(
     'Dropdown-Classification'.Selected.Value = "Please select an option" || 
     'Dropdown-Status'.Selected.Value = "Please select an option" || 
     'Dropdown-Hours'.Selected.Value = "Hour" || 
     'Dropdown-Minutes'.Selected.Value = "Minutes" || 
     'Dropdown-JobSpecific'.Selected.Value = "Please select an option" ||
     'Dropdown-BusinessUnit'.Selected.Value = "Please select an option" || 
     'Dropdown-SourceFunction'.Selected.Result = "Please select an option" || 
     'Dropdown-CauseCategory'.Selected.Title = "Please select an option" || 
     'Dropdown-Source'.Selected.Value = "Please select an option" || 
     'Dropdown-BusinessChange'.Selected.Value = "Please select an option" ||
    
    And('Dropdown-Status'.Selected.Value = "Open",IsBlank(Txt-ImmediateCorrection.Text),IsBlank(Txt-PermanentPreventative.Text)),
    
     
     Notify("Please fill out all items, anything highlighted in red requires something entering");
     Set(varOnSubmit, true),
     Navigate(Costs,Cover);
     Set(varOnSubmit, false) 
    )

     

    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.

  • Dave-ITMan Profile Picture
    on at

    Hi @NandiniBhagya20  thanks for this, that has worked. Can you advise what I would need to put as the border colour for the two text fields please so that they are red if they haven't been filled in with any information? I have done the below but clearly done something wrong.

     

    If(varOnSubmit & ('Dropdown-Status'.Selected.Value = "Closed"), Red, RGBA(0, 18, 107, 1))

     

    Thanks Again!  

  • Verified answer
    NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi, 

    you can below to border color property of your 2 TextInput fields -

    If(varOnSubmit && 'Dropdown-Status'.Selected.Value = "Closed" && IsBlank(Self.Text), Red, RGBA(0, 18, 107, 1))

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard