web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : kIVnVmPkDufbaJcCWAfz5/
Power Apps - Building Power Apps
Answered

Required Fields

Like (0) ShareShare
ReportReport
Posted on 26 Apr 2023 15:40:40 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:
I have the same question (0)
  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on 26 Apr 2023 at 16:01:53
    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).

  • ShondaT Profile Picture
    228 on 26 Apr 2023 at 16:47:07
    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. 

  • SolTeferi Profile Picture
    on 26 Apr 2023 at 18:57:26
    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) ); 

     

  • Verified answer
    mmollet Profile Picture
    3,187 on 26 Apr 2023 at 19:22:56
    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. 

  • ShondaT Profile Picture
    228 on 26 Apr 2023 at 23:37:43
    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
    NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on 27 Apr 2023 at 06:11:27
    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))

  • Verified answer
    ShondaT Profile Picture
    228 on 27 Apr 2023 at 13:47:22
    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!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 686 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 433 Super User 2025 Season 2

#3
wolenberg_ Profile Picture

wolenberg_ 266 Moderator

Last 30 days Overall leaderboard
Loading complete