cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NelsonNdimba
New Member

Pop Up validation error

Hi everyone,

I have a validation set on cards on an acordian form. The form has sections. So I have a switch button that hides sectionA, however my sectionA still validates even if hidden. I need a way out of this. I have a deadline at 10am(South African time) today.
Code below:

If(

//SectionAPopUpValidations
IsBlank(DataCardValue28_2.Selected.Value),
Set(varShowPopup, true),

IsBlank(DataCardValue12_2.Text),
Set(varShowPopup, true),

 

//SectionBPopUpValidations
IsBlank(DataCardValue16_2.Selected.Value),
Set(varShowPopup, true),


//SectionDPopUpValidations
IsBlank(DataCardValue48_2.Text),
Set(varShowPopup, true),

Refresh('PR1 Units'),
SubmitForm(Form1_2)
);

5 REPLIES 5
WarrenBelz
Super User
Super User

Hi @NelsonNdimba ,

You did not say which one was Section A

If(
   (
      IsBlank(DataCardValue28_2.Selected.Value) && 
      DataCardValue28_2.Visible
   ) ||
   (
      IsBlank(DataCardValue12_2.Text) && 
      DataCardValue12_2.Visible
   ) ||
   (
      IsBlank(DataCardValue16_2.Selected.Value) &&
      DataCardValue16_2.Visible
   ) ||
   (
      IsBlank(DataCardValue48_2.Text) &&
      DataCardValue48_2.Visible
   ),
   Set(varShowPopup, true),
   Refresh('PR1 Units');
   SubmitForm(Form1_2)
)

 

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.

Visit my blog Practical Power Apps

Hi @WarrenBelz 
Thank you for the reply. So I have this form

NelsonNdimba_0-1663925784687.png

That "Internal Candidate"  switch button hides Section A. however, the datacards under that section still validates and I was looking for a way to fix that. On my below code, I want to check if the switch is on, validate everything including sectoinA. If the switch is off, validate from sectionB going down. 

If(
//Truebrabch
If(canditateTypeToggle_2.Value=true,IsBlank(DataCardValue28_2.Selected.Value),
Set(varShowPopup, true),
IsBlank(DataCardValue12_2.Text),
Set(varShowPopup, true),
IsBlank(DataCardValue16_2.Selected.Value),
Set(varShowPopup, true),
IsBlank(DataCardValue48_2.Text),
Set(varShowPopup, true),


//Falsebranch
IsBlank(DataCardValue16_2.Selected.Value),
Set(varShowPopup, true),
IsBlank(DataCardValue48_2.Text),
Set(varShowPopup, true))
Refresh('PR1 Units'),SubmitForm(Form1_2)
);

@NelsonNdimba ,

Did you try the code I posted  - I was responding to the code and information you provided.

NelsonNdimba
New Member

Yes, It still validates the section even when hidden.

I added two conditions at the bottom to see if it will not validate but that did not work. See below:

NelsonNdimba_0-1663928905647.png

 

@NelsonNdimba ,

If you are hiding an entire Form, substitute the Control Visible for YourFormName.Visible.

 

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.

Visit my blog Practical Power Apps

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (1,551)