How to validate whether the file that we are using in Teams Channels is exists or deleted in SharePoint?

DeveloperTeams 20 Reputation points
2024-05-20T06:01:12.5966667+00:00

Hi Microsoft Team,

I have attached few Files and Folders in Channel's Files Tab and I have deleted a Team permanently by deleting the group from recycle bin which also deletes the SharePoint site created for that particular group. Is there an API/alternative solution to validate whether the file that we are using in Teams is already deleted in SharePoint or not? Because this data helps us to provide some information to user.

Please kindly help with a detailed technical solution asap for both the question.

Thanks

Microsoft 365 and Office SharePoint Development
Microsoft Teams Development
Microsoft 365 and Office SharePoint For business Windows
Microsoft Teams Microsoft Teams for business Other
{count} votes

1 answer

Sort by: Most helpful
  1. JimmyYang-MSFT 58,641 Reputation points Microsoft External Staff
    2024-05-20T09:45:00.66+00:00

    @DeveloperTeams

    One alternative solution to validate whether the file that you are using in Teams is already deleted in SharePoint is to check the recycle bin of the SharePoint site. When you delete a file from a SharePoint site, it is moved to the recycle bin of the site. If the file has been deleted from the SharePoint site, it will be in the recycle bin. Here are the steps you can follow:

    1. Go to the SharePoint site where the file was located.
    2. Click on the gear icon in the top right corner and select "Site contents".
    3. In the left-hand menu, click on "Recycle bin".
    4. Search for the file in the recycle bin. If it is there, it has been deleted from the SharePoint site.
    5. If the file is not in the recycle bin, it may have been permanently deleted and cannot be recovered.

    Note: If the SharePoint site has been deleted along with the Teams team, this solution will not work.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.