Delete items of list with no parents

Hello all,

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,

Maxime

Best Answer

  • LipChean_Soh
    Answer ✓

    Hi,

     

    Another possibility is that these 3 lists have selective access turned on and you've granted yourself the R/W access to the Top Level Item from FIN1.

     

    Members without parents can't be seen by you in the module though you can see them in the List as the workspace admin.

     

    Thanks,

    LipChean

Answers

  • @Maxime.Schaller 

    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

    Abhay

     

  • Hi Abhay,

    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.

    Regards,

    Maxime

  • @Maxime.Schaller 

    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 module

     

     

  • Hi @Maxime.Schaller 

     

    LipChean_Soh_0-1623977476267.png

    I have 2 lists with parent child relationship shown above.

     

    LipChean_Soh_1-1623977507680.png

    All members from L2 Account have parents, except X.

     

    LipChean_Soh_2-1623977534429.png

    LipChean_Soh_3-1623977543343.png

    1. A system module is created, where the 'Delete?' line item checks if L2 Account has any parents.

     

    LipChean_Soh_4-1623977618929.png   LipChean_Soh_5-1623977644394.png 

    LipChean_Soh_6-1623977695802.png

     

    Create and run the above action, and X (or any new L2 Account members in the future without parents) will be deleted.

     

    Thanks,

    LipChean

  • Hi Maxime,
    Please share screenshots if you can. I tried to mimic your problem but I have no issue with deleting action using a system module.

    Jim
  • Hi,

    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

     

    MaximeSchaller_0-1623998610158.png

     

    Example of item with no parent in the list:

     

    MaximeSchaller_1-1623998675131.png

     

    Delete module:

     

    MaximeSchaller_3-1623998757093.png

    The result with the filter:

     

    MaximeSchaller_4-1623998828452.png

     

    Regards,

    Maxime

     

     

     

     

  • Hi @Maxime.Schaller 

     

    At what part of the process are you stuck? 

    It looks like you have all the elements needed.

     

    Thanks,

    LipChean

  • Hi LipChean,

     

    The delete module doesnt contain the items with no parent.

     

    Example with this one:

     

    MaximeSchaller_0-1623999258849.png

     

    MaximeSchaller_1-1623999312424.png

     

    Not sure if it's because of the numbered list ?

     

     

  • Hi @Maxime.Schaller 

     

    Can you show us the formula of 'FIN3 Parent Account#.NoParent?', i.e. the property in the 'FIN3 Parent Account#' list?

     

    Thanks,

    LipChean

  • I dont use this property for the moment, it was just for try.

    The end of the delete module looks like this:

    MaximeSchaller_0-1624000282054.png

     

    Nothing after the last parent...

  • Hi @Maxime.Schaller 

     

    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?

     

    Thanks,

    LipChean

  • I can see it after the main parent:

     

    MaximeSchaller_0-1624002267041.png

     

    But not in the delete, which is strange...

     

     

     

  • Hi LipChean,

     

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

  • Hi @Maxime.Schaller 

     

    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.

     

    Thanks,

    LipChean

  • Hi LipChean,

     

    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.

  • 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.