web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Cosmos DB Error: Parti...
Power Automate
Unanswered

Cosmos DB Error: PartitionKey extracted from document doesn't match the one specified in the header

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

I am creating a flow which is triggered by a dashboard tile and the action is to write tile data to Azure Cosmos DB collection. 

The collectionis partitioned by and ID which is an integer field.

Even though I provided the partition key value in "Partition key value" field, it always throws the following error:

{
"code": "BadRequest",
"message": "Message: {\"Errors\":[\"PartitionKey extracted from document doesn't match the one specified in the header\"]}\r\nActivityId: 1b0eb91a-6479-431c-8b26-3c57da3cfe64, Request URI: /apps/9fafd838-06d1-49bc-a854-8aa18a214421/services/78d4e987-0be0-4e26-abb3-22dbbb60f06a/partitions/108373ab-2e88-4ed7-9fd2-5367d13369be/replicas/131891964029515465p/, RequestStats: \r\nRequestStartTime: 2018-12-14T18:58:51.7746339Z, Number of regions attempted: 1\r\n, SDK: Microsoft.Azure.Documents.Common/2.1.0.0"
}
 
Also the header does not have "x-ms-documentdb-partitionkey" in it.
Any help resolving this would be appreciated.
Thanks.
Categories:
I have the same question (0)
  • v-bacao-msft Profile Picture
    Microsoft Employee on at

    Hi @Prasanjeet,

     

    Could you please share a full screenshot of the configuration of your flow?

    Could you provide more details about Azure Cosmos DB collection configuration?

    Please provide more details about configuration and we may provide a workaround for you.

     

    Best Regards,

    Barry

  • GabrielStJohn Profile Picture
    Microsoft Employee on at

    Hey, @Prasanjeet!

    Thank you for posting on the Flow Community Forum! It appears as though @v-bacao-msft would like some more information in order to further assist you properly with your issue. Please share any additional information that was requested in order to decrease the amount of time that it will take for you to be assisted!

    Thank you for being an active member of the Flow Community!

    -Gabriel
    Flow Community Manager

  • vijayvelaga Profile Picture
    Microsoft Employee on at

    For x-ms-documentdb-partitionkey value you would need to specify the partition key value ("1234") and not the partition key attribute ("id").

    x-ms-documentdb-partitionkey: [ "1234" ]

    Once you do this, documents matching this partition key value will be returned.

  • RudeSome Profile Picture
    3 on at

    this tbh, thanks!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard