cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Highlighted
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
Highlighted
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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,582)