cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

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
Community Support

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
Community Support

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

Highlighted
Helper III
Helper III

Re: How to create error message and stop navigation

Thanks!

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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