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

How to create error message and stop navigation

Hi Community,

 

I have the below form where value in Report ID is unique. It retrieves the value from the SharePoint list.

Currently when Report ID is not unique, the write to SharePoint does not happen but it still navigates to the next screen. As such, one would have thought the save was done, without noticing the error.

 

1.PNG

 

How can 1) I display a error message whenever the report ID is not unique (the check can only happen when one clicks on the Create button and tries to write to SharePoint) , and 2) prevent navigation to the next screen?

 

The Create button does the patching and also navigation. 

 

Set(HeaderID1, Value(DataCardValue11_1.Text));
Patch(Header3,Defaults(Header3),{Title: DataCardValue18_1.Text, HeaderID:HeaderID1, Name:DataCardValue19_1.Text, EmailAddress:DataCardValue20_1.Text, Purpose: DataCardValue23_1.Text, Department: DataCardValue21_1.Text, ClaimSubmissionDate: DataCardValue27_1.SelectedDate, Status: "Open"});
Set(SelectedReport,Last(Header3));
UpdateContext({clearform:false});
UpdateContext({clearform:true});
Navigate(Test2_Details,None);

 

Thank you for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to create error message and stop navigation

Hi @elleeyl ,

 

Please use below formula to achieve this:

If(IsBlank(Lookup(Header3,'Report ID'=DataCardValue11_1.Text)),
Patch(...)&&Navigate(Test2_Details,None),
Notify("Duplicated Report ID!", NotificationType.Error ))

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: How to create error message and stop navigation

Hi @elleeyl ,

 

Please use below formula to achieve this:

If(IsBlank(Lookup(Header3,'Report ID'=DataCardValue11_1.Text)),
Patch(...)&&Navigate(Test2_Details,None),
Notify("Duplicated Report ID!", NotificationType.Error ))

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

elleeyl
Level: Powered On

Re: How to create error message and stop navigation

Thanks!

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 (4,173)