Skip to main content

Notifications

Power Automate - Using Connectors
Answered

Cosmos DB Delete Document Fails

(1) ShareShare
ReportReport
Posted on by 8

I'm have very simple Power Automate using Cosmos DB connectors:

 

  1. Cosmos Get All Documents (V3)
    1. Apply to each body/Documents
      1. Cosmos Delete a document (V2)
        1. Database ID: xxx
        2. Collection ID: xxx
        3. Document ID: items('Apply_to_each')['id']

I have verified that all connections to db, collection and document Id's exist and return as expected.

I get the error:  Entity with the specified id does not exist in the system

The id does in fact exist checking in both Azure data explorer as well as the response from Get All Documents (V3). The Power Automate debugger lists the correct id in the Document ID field.

 

This one has me really confused! Thank you.

 

 

           

  • jarra64 Profile Picture
    jarra64 8 on at
    Re: Cosmos DB Delete Document Fails

    Thank you @enzocano I didn't realize the double quote requirement for string partition keys. 

  • Verified answer
    enzocano Profile Picture
    enzocano 9 on at
    Re: Cosmos DB Delete Document Fails

    I had the same problem; you should define the proper partition key to fix it.

    For example, if you partition key is `/id` you must add that to the delete step. Also, you must cast the partition key to be string by enclosing the value with double quotes ("<value>") if you are using string (reference).

     

    The following example is to delete a testcosmos document with "testcosmos" partition key

     

    enzocano_1-1654030809908.png

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard

Featured topics