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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,659)