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 Apps
Answered

Submit Button

(0) ShareShare
ReportReport
Posted on by 84

Good afternoon,

 

Today I am working on a PowerApp at work and need some assistance with the submit button. I am trying to get 5 data cards answered before a user can submit a form. 

 

I am trying to get First Name, Last Name, Badge Type, Start Date and End Date 
I have a few pictures that will be able to explain it better.

Look forward to hearing from you all!
Capture.PNGCapture2.PNG

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Ajilakes 

    You didn't mention where you put your formula.  It should be in the DisplayMode property of the button. 

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Ajilakes 

    My suggestion can be found below.  The ( ! ) symbol means the same as NOT.  Therefore, the code says "when all the fields are NOT blank change the Display Mode to Edit".

    Make sure to place this code in the DisplayMode property of the button.

     

    If(
     And(
     !IsBlank(DataCardValue3.Text),
     !IsBlank(DataCardValue4.Text),
     !IsEmpty(DataCardValue3.Selected),
     !IsBlank(DataCardValue5.SelectedDate),
     !IsBlank(DataCardValue6.SelectedDate)
     ),
     Edit,
     Disabled
    )

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Ajilakes Profile Picture
    84 on at

    @mdevaney 

    @Drrickryp 

     

    My issue is that when I select the deactivate badge type and fill out the option it won't allow me to submit since I don't have the start date Datacard. With Reactivate we have an end date and start date and it works with that. I will show you the pictures to explain better and yes I was putting the code in the DisplayMode of Submit Button.

    Look forward to hearing from you all

     

    Start Date doesn't work for Lost/Damaged

    Start Date and End Date work for Reactivate/Expired

    End Date for Deactivate doesn't work

     

     

    Capture3.PNGCapture4.PNGCapture5.PNG

  • Ajilakes Profile Picture
    84 on at

    @mdevaney 

    It didn't work for Deactivate and Lost/Damaged. I will attach a few photos to show you what is happening. I have also been putting that code in Submit Buttons (DisplayMode). It works for Reactivate which has both the start and end date. 

     

    Look forward to hearing from you

     

    Capture3.PNGCapture4.PNGCapture5.PNG

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Ajilakes 

    Everything appears to be working properly per your original spec.  You said "disable the button until these 5 fields all have values", correct?  In your screenshot the disable button appears to be working as I expected because either start or end date information is missing.

     

    Please let me know if you have different requirements.

  • Ajilakes Profile Picture
    84 on at

    @mdevaney 

    Everything is working so far but the issue is that for Deactivate I have the start date filtered out on the form. When someone selects Lost/Damage badge type they only see a Start Date because I have the End Date filtered out on the form for this badge type. The issue is when someone tries to fill out the form for Deactivate the submit button won't appear because it's still expecting the start date but it's filtered out on this part. The same things happen to Lost/Damaged badge types when someone tries to fill out the information they won't be able to submit because the End Date is filtered out for this part of the form. 

  • Verified answer
    mdevaney Profile Picture
    29,993 Moderator on at

    @Ajilakes 

    Then we have to modify the earlier statement.

     

    If(
     And(
     !IsBlank(DataCardValue3.Text),
     !IsBlank(DataCardValue4.Text),
     Or(
     // condition for any status other than lost or deactivate
     !IsEmpty(DataCardValue3.Selected)
     && !IsBlank(DataCardValue5.SelectedDate)
     && !IsBlank(DataCardValue6.SelectedDate),
     // condition for statuses lost or deactivate
     DataCardValue3.Selected.Value in ["Lost/Damaged","Deactivate (Terminated/Retired)"]
     && && !IsBlank(DataCardValue6.SelectedDate)
     )
     ),
     Edit,
     Disabled
    )

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Ajilakes Profile Picture
    84 on at

    I was able to solve this with the code given above but I did some fixture on what I needed from the data fields. 

    So here is my code:

     

    If(
    And(
    !IsBlank(DataCardValue3.Text),
    !IsBlank(DataCardValue4.Text),
    Or(
    // condition for any status other than lost or deactivate
    DataCardValueStatus.Selected.Value in ["New Employee"] && !IsEmpty(DataCardValueStatus.Selected.Value) && !IsBlank(DataCardValue5.SelectedDate),
    // condition for statuses lost or deactivate
    DataCardValueStatus.Selected.Value in [
    "Lost/Damaged",
    "Deactivate (Terminated/Retired)"
    ] && !IsBlank(DataCardValue5.SelectedDate) || !IsBlank(DataCardValue6.SelectedDate),
    // condition for statuses visitor or reactivate/expired
    DataCardValueStatus.Selected.Value in [
    "Reactivate/Expired",
    "Visitor"
    ] && !IsBlank(DataCardValue5.SelectedDate) && !IsBlank(DataCardValue6.SelectedDate)
    )
    ),
    Edit,
    Disabled
    )

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
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard