Share via

Unable to remove the default Document content type froma document library using REST API

john john 1,031 Reputation points
2023-09-27T22:49:57.7466667+00:00

This is not a question about power automate, but about SharePoint rest api.

I have a workflow which creates a new document library, then add a custom content type and remove the document content type. but it is failing when trying to remove the Document content type:-

 

Cannot find resource for the request SP.RequestContext.current/web/lists/getbytitle('2024')/ContentTypes('0x0101')/

 

Here is the flow:-

 

  1. I am getting the ID of the Document content type + I am getting the Id of the custom content type and parse the results:-

 

johnjohn123_2-1695854536031.png

 

  1. then i am creating the a new document library:

 

johnjohn123_3-1695854591607.png

 

 

  1. then i am adding the new custom content type:-

 

johnjohn123_4-1695854622457.png

 

 

 

  1. then finally when i try to remove the Document content type-

 

johnjohn123_5-1695854652140.png

 

I got this error:-

Cannot find resource for the request SP.RequestContext.current/web/lists/getbytitle('2024')/ContentTypes('0x0101')/

 

here is the request on runtime:-

 

johnjohn123_6-1695854861588

 

 

so what could be the issue?

Thanks

 

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2023-09-28T02:15:12+00:00

    HI @john john

    Since your issue is about powers automate, and our forum focus on SharePoint. I wil recommend you to raise a new ticket Microsoft Power Automate Community. This is a Microsoft forum dedicated to discussing Power Automate. You might get some more professional advice there. Thanks for your understanding.
    I am currently doing some research on this issue, will let you know as soon as possible


    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.

    Was this answer helpful?


Your answer

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