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 formula to ensure d...
Power Apps
Answered

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
    Microsoft Employee 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

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 294 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 169

Last 30 days Overall leaderboard