The given key 'CNPJ' was not present in the dictionary

Hello Folks.

Can someone tell me why I’m receiving this error message considering that this is the content of my dictionary.

QueueItem { AssignedTo=null, DeferDate=null, DueDate=null, Id=590368050, ItemKey=[7a5c1ab1-7f7d-4bb9-8428-4a9e6bc88bc8], LastProcessingOn=null, Output=null, ParentOperationId=“504262defff44117b5d0cc5571aa13cb-b5d693c834a04ddbaccbfc96ddc95c08”, Priority=Normal, ProcessingException=null, Progress=“”, QueueDefinitionId=1054908, QueueName=“Teste”, Reference=“Segundo Cliente”, RetryNo=0, ReviewStatus=“None”, RowVersion=byte[8] { 0, 0, 0, 0, 90, 27, 176, 250 }, SpecificContent=Dictionary<string, object>(2) { { “"Nome da Empresa"”, “Segundo Cliente” }, { “"CNPJ"”, “23.989.965/0001-98” } }, StartTransactionTime=[03/29/2025 12:11:22], Status=InProgress, UniqueKey=[7a5c1ab1-7f7d-4bb9-8428-4a9e6bc88bc8] }

As you can see I have a key named “CNPJ” on it.

This is my activity ==>

It should find the key in the dictionary…

Thank you in advance.

Hey @egameiro
In your QueueItem the key is not called CNPJ, but literally “CNPJ”.
That’s why TransItem.SpecificContent(“CNPJ”) returns an error - because there is no such key without those quotes.
Change the reference in the code to:
TransItem.SpecificContent("""CNPJ""").ToString

Thank you Pikorpa…

It was the issue

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.