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 Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,431 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,917 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,098 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,388 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JimmyYang-MSFT 54,326 Reputation points Microsoft Vendor
    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.