cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Ajilakes
Level: Powered On

Submit Button

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

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Submit Button

@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."

View solution in original post

8 REPLIES 8
Super User
Super User

Re: Submit Button

Hi @Ajilakes 

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

Super User
Super User

Re: Submit Button

@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
Level: Powered On

Re: Submit Button

@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
Level: Powered On

Re: Submit Button

@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

Super User
Super User

Re: Submit Button

@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
Level: Powered On

Re: Submit Button

@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. 

Super User
Super User

Re: Submit Button

@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."

View solution in original post

Ajilakes
Level: Powered On

Re: Submit Button

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
)

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (3,850)