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

show Error message to user

Hi, 

 

I have a form and on selecting the save button I would like it to show a message to users if one of the dataCard is empty. so this is my code:

 

If(!IsBlank(DataCardValue13.Text), And(SubmitForm(Form1),Navigate(PartnerSearch, ScreenTransition.Cover)),Label10.Text="error")

 

So I dont understand why the message does not show? 

 

the save button wont work unless the datacard have some text. 

 

Appreciate your help.

 

Thanks 

1 ACCEPTED SOLUTION

Accepted Solutions
hpkeong
Community Champion
Community Champion

Hi

 

Chain reaction in PowerApps use ";".

To show something, use UpdateContext({contextvariable: true})

 

Your error message resides in a label called

- Label10.Text with "error" text.

Set the Label19.Visible = show (or any name you wish)

 

In your case, when you click Save Button, you can write

- If(!IsBlank(DC.Text), SubmitForm(Form1); Navigate(Screen1, Transition), UpdateContext({show: true}))

 

In order to hide the "error" message again, just make sure that when you start to fill in something in DataCard, the error message disappear.

Just use UpdateContext({show: false}) following to your action on the DataCard.

 

Hope this helps.

hpkeong

View solution in original post

2 REPLIES 2
hpkeong
Community Champion
Community Champion

Hi

 

Chain reaction in PowerApps use ";".

To show something, use UpdateContext({contextvariable: true})

 

Your error message resides in a label called

- Label10.Text with "error" text.

Set the Label19.Visible = show (or any name you wish)

 

In your case, when you click Save Button, you can write

- If(!IsBlank(DC.Text), SubmitForm(Form1); Navigate(Screen1, Transition), UpdateContext({show: true}))

 

In order to hide the "error" message again, just make sure that when you start to fill in something in DataCard, the error message disappear.

Just use UpdateContext({show: false}) following to your action on the DataCard.

 

Hope this helps.

hpkeong

View solution in original post

Anonymous
Not applicable

there is a save button that upears OOTB on the top of the form and UpdateContex canot be used on rules belonging to global controls. Do anyone have a solution for this issue?

 

Thanks. 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (90,659)