cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Berihun1
Frequent Visitor

Power App Data Validations

urgent Support Power App Data Validation
In power app I have different field with Error Message shown  i want only to show/display these “Error Message” only if user try to hit “submit” Button when field are empty under each field.
Spoiler
Spoiler
1Capture.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Berihun1 ,

I assume you are referring to the red labels under the text controls. You need  Variable here - firstly initiate it at screen OnVisible

UpdateContext({varError: false})

Now on your Save button OnSelect put this

If(
   Value(YourAgeBoxName.Text) > 0 && Value(YourFamilySizeBoxName.Text) > 0,
   UpdateContext({varError: false});
   SubmitForm(YourFormName),
   UpdateContext({varError: true})
)

The last bit is the Visible on your error labels

varError && !(Value(Self.Text) > 0)

I am assuming here that a number must be entered. Also (if you have not already) set the format to Number

WarrenBelz_0-1653177869785.png

 

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

 

 

View solution in original post

5 REPLIES 5
Himanshu90677
New Member

Can you try

If(IsBlank(labelAge),Notify("Please enter the value, reason",NotificationType.Error))

WarrenBelz
Super User
Super User

Hi @Berihun1 ,

I assume you are referring to the red labels under the text controls. You need  Variable here - firstly initiate it at screen OnVisible

UpdateContext({varError: false})

Now on your Save button OnSelect put this

If(
   Value(YourAgeBoxName.Text) > 0 && Value(YourFamilySizeBoxName.Text) > 0,
   UpdateContext({varError: false});
   SubmitForm(YourFormName),
   UpdateContext({varError: true})
)

The last bit is the Visible on your error labels

varError && !(Value(Self.Text) > 0)

I am assuming here that a number must be entered. Also (if you have not already) set the format to Number

WarrenBelz_0-1653177869785.png

 

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

 

 

Berihun1
Frequent Visitor

t

hank you but where do I initiate variables? you mean from the error message visible property?

@Berihun1 ,

Exactly as per the code I posted.

  • Screen OnVisible
  • Button OnSelect
  • Visible of your error labels
Berihun1
Frequent Visitor

thank you i got

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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