
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
)
);
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.