How do I delete lists in SharePoint that are related to other lists.

Anonymous
2024-08-21T14:17:55+00:00

I have seen many questions like this, but have yet to find an answer that works for me.

I linked Sharepoint to Access. All the tables were uploaded to SharePoint. Now I am unable to delete them and get a message "This list cannot be deleted because one or more lists are related to it."

If I was able to select multiple lists and delete them all at once that would be a great, simple solution. However, SharePoint does not allow me to do that (or at least I cannot figure out how).

I have tried deleting all the data from the list and deleting it, but get the same error. I have searched through settings but have not found anyway to break the relationship, or assist me in my quest.

Microsoft 365 and Office | SharePoint | Other | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

10 answers

Sort by: Most helpful
  1. Anonymous
    2024-08-21T20:16:29+00:00

    Dear JasonLarimer1,

    Good day! Thank you for posting to Microsoft Community. We are happy to help you.

    We are sorry to hear that you’re having trouble with deleting lists in SharePoint that are related to other lists. I deeply understand the inconvenience caused and apologize for it.

    Could you please have a look at some of the steps you can try to resolve this:

    1. Identify and Remove Lookup Columns first and then delete the List. Go to the list settings. Under the “Columns” section, find and delete any lookup columns that reference other lists. The column type would be Lookup.
    2. Since you mentioned that you linked through Access, you might need to break these relationships in Access first. Open your Access database. Go to the “Database Tools” tab and select “Relationships.” Delete the relationships between the tables. Save your changes and try deleting the lists in SharePoint again.
    3. I have also tried to bulk delete the lists by including the -force parameter however, I got the same error, and it seems the lists can only be deleted after removing the lookup columns.

    We appreciate your understanding that sometimes the initial response may not resolve the problem immediately. However, we can work together to narrow down and resolve the situation. So, for further troubleshooting, could you please provide the information below:

    1. Could you please let know how you linked your SharePoint to Access?
    2. Could you please provide a screenshot related to the issue/error? You can upload the screenshot using this feature:

    Once again, I apologize for the inconvenience this has caused. We appreciate your patience and understanding and thank you for your time and cooperation.

    Sincerely,

    Ralph Chawatama | Microsoft Community Moderator

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2024-08-23T15:56:17+00:00

    I agree with above answer with one exception ...

    This is incorrect - "Since you mentioned that you linked through Access, you might need to break these relationships in Access first."

    If you have exported the Access Tables to SharePoint Lists then there is no connection between the two anymore and so no point in deleting the Access table relationships.

    I'm in the middle of a laborious process of this involving 30 tables - all linked to at least one other table!

    All because one field in one table was called Title which, it turns out, is a reserved word in SharePoint. Going to have to change the name of the field in the table - and all the queries and forms its based on :-( and then try exporting again.

    Shame there's no easier way of managing these operations like in Access

    0 comments No comments
  3. Anonymous
    2024-08-27T16:04:40+00:00

    Dear MassimoGiannuzzi,

    Good day! hope you are doing well.

    I hear you and understand that this limitation can be frustrating, and I sincerely apologize for any inconvenience caused. We value your understanding, and I also agree with you that this would be a great addition to the features of Microsoft Office 365.

    Microsoft values user feedback. We encourage you to share your thoughts and suggestions through our feedback community under SharePoint · Community (microsoft.com). The product development team monitors this site around the clock and your feedback will be considered. This is the best way to let the team know your needs and help improve our products and services. We hope to see this feature in the future version of SharePoint Lists.

    Thank you for your patience, understanding, and cooperation.

    Sincerely,

    Ralph Chawatama | Microsoft Community Moderator

    0 comments No comments
  4. Anonymous
    2024-08-27T17:20:22+00:00

    For Step 1 I do not see any column types with "lookup". My list settings and columns section do not look like what you have displayed.

    0 comments No comments
  5. Anonymous
    2024-08-30T23:07:20+00:00

    Dear JasonLarimer1,

    Good day! hope you are doing well.

    I have also reproduced almost exactly the same issue with similar columns like the one you showed me.

    The general rule for deleting a list in SharePoint is that you need to delete every single column, including the ID column, for every list linked to the column. Examples of columns you should delete are shown in the list below. After deleting these from all the related lists, you can then delete the lists.

    The other method would be to use the following PowerShell Command to delete all the columns and then delete the list.

    1. Connect to your SharePoint site: Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/yoursite" -UseWebLogin
    2. Specify the lists you want to modify and delete: $lists = @("List1", "List2", "List3")  # Add your list names here
    3. Loop through each list, remove all fields, and then delete the list: foreach ($list in $lists) {     $fields = Get-PnPField -List $list     foreach ($field in $fields) {         Remove-PnPField -List $list -Identity $field.InternalName -Force     } } foreach ($list in $lists) {     Remove-PnPList -Identity $list -Force }

    You will notice a lot of errors as the code will also try to delete the default columns which cannot be deleted. However, you can just ignore and wait for the script to complete

    Disclaimer: The sample scripts provided are only for reference and are not supported under any Microsoft support program or service.  The scripts are provided AS IS without warranty of any kind and you assume all risks when using them. Microsoft shall not be held liable for any damages whatsoever arising out of the use of or inability to use the sample scripts.

    Thank you for your patience, understanding, and cooperation.

    Sincerely,

    Ralph Chawatama | Microsoft Community Moderator

    1 person found this answer helpful.
    0 comments No comments