Showing results for 
Search instead for 
Did you mean: 
New Member

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

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/"
Also the header does not have "x-ms-documentdb-partitionkey" in it.
Any help resolving this would be appreciated.
Community Support
Community Support

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,


Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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!

Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager

New Member

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.

this tbh, thanks!

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,570)