Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Required Fields

(0) ShareShare
ReportReport
Posted on by 228

On the OnSubmit property for my submit button I have the code shown below that isn't allowing the user to correct the required fields before moving to the success screen. Can someone please tell me what I'm missing?

 

If(IsBlank(DataCardValue18_1) || IsBlank(DataCardValue11) || IsBlank(Radio2_1) || IsBlank(Radio3_1) || IsBlank(DataCardValue62_3) || IsBlank(DataCardValue25) || IsBlank(DataCardValue114_1)|| IsBlank(DataCardValue175)|| IsBlank(DataCardValue171)|| IsBlank(DataCardValue169)|| IsBlank(DataCardValue72_1)|| IsBlank(DataCardValue118_1)|| IsBlank(DataCardValue119_1)|| IsBlank(DataCardValue174), Notify("Please check the General and Frontrunner Tabs for Required Fields.", NotificationType.Error), SubmitForm(NCAForm_2)); Navigate(SuccessNCA, ScreenTransition.Fade)

 

Thanks in advance! 🙂

Categories:
  • Verified answer
    ShondaT Profile Picture
    228 on at
    Re: Required Fields

    @NandiniBhagya20I should have seen that! It's working perfectly now! I also took @mmollet advisement to move the navigate code to the OnSuccess form property. Thanks so much to all of you!

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

    Hi @ShondaT ,
    There is an extra "(" opening parenthesis before "(IsBlank(Radio2_1.Selected.Value)". Try using below formula - 

    If(IsBlank(DataCardValue49_1.Selected.DisplayName) || IsBlank(Radio2_1.Selected.Value) || IsBlank(Radio3_1.Selected.Value) || IsBlank(DataCardValue11.Text) || IsBlank(DataCardValue62_3.SelectedDate) || IsBlank(DataCardValue25.Selected.Value) || IsBlank(DataCardValue114_1.Selected.DisplayName) || IsBlank(DataCardValue175.Selected.Value) || IsBlank(DataCardValue171.Selected.Value) || IsBlank(DataCardValue169.Selected.Value) || IsBlank(DataCardValue72_1.Text) || IsBlank(DataCardValue118_1.Text) || IsBlank(DataCardValue119_1.Text) || IsBlank(DataCardValue174.Selected.Value), Notify("Please check the General and Frontrunner Tabs for Required Fields.", NotificationType.Error), SubmitForm(NCAForm_2); Navigate(SuccessNCA, ScreenTransition.Fade))

  • ShondaT Profile Picture
    228 on at
    Re: Required Fields

    @mmollet @NandiniBhagya20 @SolTeferi 

     

    This is what I have now and I'm getting an error on the comma just before "Notify"

    If(IsBlank(DataCardValue49_1.Selected.DisplayName) ||(IsBlank(Radio2_1.Selected.Value) || IsBlank(Radio3_1.Selected.Value) || IsBlank(DataCardValue11.Text) || IsBlank(DataCardValue62_3.SelectedDate) || IsBlank(DataCardValue25.Selected.Value) || IsBlank(DataCardValue114_1.Selected.DisplayName) || IsBlank(DataCardValue175.Selected.Value)|| IsBlank(DataCardValue171.Selected.Value) || IsBlank(DataCardValue169.Selected.Value) || IsBlank(DataCardValue72_1.Text) || IsBlank(DataCardValue118_1.Text) || IsBlank(DataCardValue119_1.Text) || IsBlank(DataCardValue174.Selected.Value), Notify("Please check the General and Frontrunner Tabs for Required Fields.", NotificationType.Error), SubmitForm(NCAForm_2));

  • Verified answer
    mmollet Profile Picture
    3,187 on at
    Re: Required Fields

    I agree with what everyone above me said but I have one thing to add. I would take the Navigate part at the end off completely and paste it in the Form's OnSuccess property. This will make this code execute better as well as then that code will be where it should be for execution. This will also ensure it is only ran when the form is successfully submitted. 

  • SolTeferi Profile Picture
    on at
    Re: Required Fields

    Hi @ShondaT ,

    NandiniBhagya20 is correct on the data types and using the values, not the controls.

    But, the reason your submit button directs to the success screen even if there is error is because you put the Navigate function outside the IF function. Below is how the last part of your formula should look like, which places the Navigate function inside the IF function.

     

     ..... SubmitForm(NCAForm_2); Navigate(SuccessNCA, ScreenTransition.Fade) ); 

     

  • ShondaT Profile Picture
    228 on at
    Re: Required Fields

    The code works if I remove the "; Navigate(SuccessNCA, ScreenTransition.Fade)" so I'm not sure if it's a matter of those controls. 

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at
    Re: Required Fields

    Hi @ShondaT ,
    Try capturing values of controls instead of directly mentioning control name in the formula. I am not aware of control type of controls you have mentioned in the formula but you can use below formula for respective control types -
    1. If control is Input, use IsBlank(DataCardValue.Text).

    2. If control is dropdown you can use IsBlank(DataCardValue.Selected.Value)

    3. In case of Toggle use !DataCardValue.

    4. In case of Radio use IsBlank(RadioControlName.Selected.Value).

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard