Delete items of list with no parents
I'm trying to delete items of a list that are not linked to a parent. Therefore i cannot use "the delete from list using selection" action.
Do you have any tips to achieve that ? The list is quite huge so it's difficult to do this clean-up manually.
Thanks for your help,
You can use delete from list using selection.
create a module with the list and a boolean line item and put the formula= isblank(parent(item(list)))
It will make true for all the items which does not have a parent and you can use that line item for your delete action.
Thanks for your reply.
When i create a module with this list i cannot see the list items with a blank parent so my delete condition is always false.
Are you using a subset of list in module?
I haven't seen what you are saying ever before. Please share SS if possible.
If an item in list and its used in module I am 100 percent sure that it will be there in module0
I have 2 lists with parent child relationship shown above.
All members from L2 Account have parents, except X.
1. A system module is created, where the 'Delete?' line item checks if L2 Account has any parents.
Create and run the above action, and X (or any new L2 Account members in the future without parents) will be deleted.
Please share screenshots if you can. I tried to mimic your problem but I have no issue with deleting action using a system module.
Thanks for all replies.
I forgot to mention that this is a numbered list, I dont know if that makes a difference.
See below the screen-shots:
The goal is to delete items of FIN3 numbered list
Example of item with no parent in the list:
The result with the filter:
At what part of the process are you stuck?
It looks like you have all the elements needed.
The delete module doesnt contain the items with no parent.
Example with this one:
Not sure if it's because of the numbered list ?0
Can you show us the formula of 'FIN3 Parent Account#.NoParent?', i.e. the property in the 'FIN3 Parent Account#' list?
I dont use this property for the moment, it was just for try.
The end of the delete module looks like this:
Nothing after the last parent...0
Assuming module 'DM24 Delete - FIN3 Parent Account' applies 'FIN3 Parent Account#' as the list, AND if you can't see '236881 - DKK - NAT - 7650' in 'DM24 Delete - FIN3 Parent Account', could it be that '236881 - DKK - NAT - 7650' is not a member of 'FIN3 Parent Account#'?
Could '236881 - DKK - NAT - 7650' be a member of FIN4 or FIN5?
I can see it after the main parent:
But not in the delete, which is strange...0
The first parent list has selective access indeed... So you're right.
I could remove the selective access but that could be dangerous. Otherwise i'll go with the manual approach...0
I'm glad we solved the main issue, i.e. why you can see the list member in the admin page, but not in the module.
Let's move on to the next topic.
If your objective is to delete the list member without a parent, the previous steps discussed still works though you cannot see/verify the list members in a module before performing the deletion step.
If the previous step is too risky, then you'll need to take another step back, and ask yourself why there are members without parents. Could a validation be done before these FIN3 members are created? During the validation, if some FIN4 members really do not have parents, can they be assigned to a technical parent, e.g. Dummy Parent.
Indeed if i create the delete action the delete is properly done. I was confused because i didnt see the items in the module because of the selective access as you said.
I have items with no parents because i started the clean-up with the parent list.
I can mark this as solved and many thanks again and to you and others for your help.0
Hi @Maxime.Schaller ,
One thing we have done in the past to find and delete orphans on a selective access list, is to create a "dummy" parent item to house all the orphaned list items and then using a list property & import action to move orphaned items to the new "dummy" parent item.
The list property formula is setup to use the existing parent if the list item has one, but for orphans calculates the "dummy" parent code (the formula is basically Calculated Parent = IF ISNOTBLANK(parent) then CODE(Parent) else "Dummy-Parent-Code"). Then we run a List to List import action and map the calculated parent line item to the item parent. After running this action your previously orphaned list items will reappear in modules under the dummy parent item.
Just sharing with the community in case anyone runs into issues like we have, where there were large numbers of orphans we needed to cleanup and needed a way to analyze in a module first before deleting, thus making a manual deletion more difficult.2