web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Remove() Error: Not ac...
Power Apps
Unanswered

Remove() Error: Not actually removing records with primary ID of less than 10 in data table?

(0) ShareShare
ReportReport
Posted on by 14

Hello all!  I am relatively new to power apps and running into a unique error with the Remove() statement.  

It occasionally does not work and fails to remove the ID in question... but it occasionally works. (with no changes)   

Below is a sample of the code.  I am checking two different drop downs in a nested If statement to determine how to handle the delete function.  The drop down assigns an entity id which is equal to the primary key of the table I want to remove the record from.   This is working correctly.  

I was able to do some trouble shooting - and I do not understand the error.  It looks like the command is failing to remove anything that has an ID less then 10.   The command works for ALL records that I've tried whose ID is greater than 9.   

It's almost like the SQL is reading the first few rows in the table as read only.  When I separated the code to its own stand alone statement (no if commands) it was generating the same issue with no populated errors.   

Any thoughts?   I do not believe it is a delegation issue as the total number of records in the table I am referencing is less than 500.  (and its only failing to remove the first 9 rows of the table).   

Thank you for your help.  

 

 

 

If(d_Actions.SelectedText.Value = "delete", 
(

If(d_EntityName.SelectedText.Value = "unit name", 
Remove('[dbo].[DimUnit]',
LookUp('[dbo].[DimUnit]',ID = Entity_Id));
ClearCollect(
 UNIT,
 Sort(
 '[dbo].[DimUnit]',
 ENTITY_NAME,
 Ascending
 )
);

 

 

 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,779 Most Valuable Professional on at

    Hi @ax_gosser ,

    I picked up your post from the unanswered list. I can possibly contribute the way I would do this

    RemoveIf(
     '[dbo].[DimUnit]',
     ID = Entity_Id &&
     d_Actions.SelectedText.Value = "delete" &&
     d_EntityName.SelectedText.Value = "unit name", 
    );
    ClearCollect(
     UNIT,
     Sort(
     '[dbo].[DimUnit]',
     ENTITY_NAME,
     Ascending
     )
    );

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 477

#2
WarrenBelz Profile Picture

WarrenBelz 341 Most Valuable Professional

#3
11manish Profile Picture

11manish 317

Last 30 days Overall leaderboard