cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ctpmthh
Helper I
Helper I

Can't override default error in Notify

Hi guys I have code like

 

patch ( source, collection);

If(IsEmpty(Errors(source))

  ,patch ( source2, collection2)

  ,Notify(Concat(Errors(source), Column&": "&Message),NotificationType.Error,19500)

)

1ctpmthh_0-1651770164719.png

 

2ctpmthh_1-1651770235109.png

 

Mostly I get error 1 ... sometimes error 2... but I want to have only error 2... ( because I know which column)...

Really I don't understand why popup this 1 error.. ( i think it generated automatically if patch failure ?... I will understand it, but why does this 2nd message/error/popup doesn't override it?

 

Thanks for the advice because I started by p... with behavior this. 🙂

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ctpmthh
Helper I
Helper I

Hi @v-bofeng-msft ,

thanks, and yes it can be part of the solution.

For now, I handle this "default error" like this

Set(errorResponse,patch());

(IsError(errorResponse))

, and this working perfectly for now !.

BR,

John Doe 😉

View solution in original post

4 REPLIES 4
Drrickryp
Super User
Super User

@ctpmthh 

To use the Patch() function in this way, the data source and the collection must have the same data structure.  To troubleshoot your issue, this would be the first question that has to be answered.  Your error indicates that one of the columns is read only so you may want to fix that too if you can. 

I handle this with this :

ClearCollect(collection1,Filter(source1,ID = ThisItem.ID));

and now i add these too

ClearCollect(updateColletion,DropColumns(collection1,"Modified","Author","ComplianceAssetId","{FilenameWithExtension}","{FullPath}","{Identifier}","{IsFolder}","{Link}","{ModerationComment}","{ModerationStatus}","{Name}","{Path}","{Thumbnail}","{TriggerWindowEndToken}","{TriggerWindowStartToken}","{VersionNumber}")); 

I want to test it... and if it happens in the future to know which columns I need to add to the Drop condition...

Why does it pop up sometimes...error 1 and sometimes error 2... its.... not logical for me 

Thanks 

Hi @ctpmthh ,

 

I suggest you to use ShowColumns to list the required fields.

ClearCollect(updateColletion,ShowColumns(collection1,"Column1","Column2")); 

 

Best Regards,

Bof

ctpmthh
Helper I
Helper I

Hi @v-bofeng-msft ,

thanks, and yes it can be part of the solution.

For now, I handle this "default error" like this

Set(errorResponse,patch());

(IsError(errorResponse))

, and this working perfectly for now !.

BR,

John Doe 😉

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,751)