cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EdevaldoJeronim
Resolver I
Resolver I

How can avoid the Error using removeif function

Hi,

I need to remove some records in TblMenuUserAplic located in Sharepoint List according to the code below highlighed in red color but i have 02 situations:

1 - the function "IfError()" don't show me the error in the screen (notify) and how i can do it?

2 - How can avoid the error "The specified record was not found. Server response. Failed TblMenuUserAplic: Item not found clientrequestid: xxx " when i execute the function remove() below. Is there a way to avoid it?

 

See code below:

IfError(

          ClearCollect(TblTempGrupoAplic;Filter(AddColumns(TblGrupoAplic;"IdUser";LookUp(TblMenuUserGrupo;IdGrupo =             TblGrupoAplic[@IdGrupo];IdUser));IdGrupo = 1));
          Notify( "Internal error: " & ErrorInfo.Control & " - Property: " & ErrorInfo.Property & " - Message: " & ErrorInfo.Message);

/* Remover os itens da aplicação */
         RemoveIf(TblMenuUserAplic;(IdUser in TblTempGrupoAplic[@IdUser]));

         Notify( "Internal error: " & ErrorInfo.Control & " - Property: " & ErrorInfo.Property & " - Message: " & ErrorInfo.Message)

);

2 REPLIES 2
RaashiSen
Community Support
Community Support

Hello @EdevaldoJeronim ,

 

For IfError(<situation>,Notify("")), Notify() expects a comma(,) before it works, in your code you are using semicolon(;), which is to disconnect the action, not chain them together.

 

Please replace them and see if that works. Something like-

IfError(

     ClearCollect(TblTempGrupoAplic;Filter(AddColumns(TblGrupoAplic;"IdUser";LookUp(TblMenuUserGrupo;IdGrupo =             TblGrupoAplic[@IdGrupo];IdUser));IdGrupo = 1)),  Notify( "Internal error: " & ErrorInfo.Control & " - Property: " & ErrorInfo.Property & " - Message: " & ErrorInfo.Message)

);

 

For your second ask, we can try using If( IsError( RemoveIf(TblMenuUserAplic;(IdUser in TblTempGrupoAplic[@IdUser])) ), Notify( "" ) ). 

 

Please check and tell if that helps 🙂

Hi @RaashiSen ,

For Brazilian language we need to change colon(,) to semicolon (;) and semicolon(;) to double semicolon (;;)

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PWREduCon768x460.png

Join us at PWR EduCon - A Power Platform Conference

Learn from the top Power BI, Power Apps, Power Automate & Power Virtual Agents experts!

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