Getting Subject Line from Email

So I am trying to get the subject line from an email that is being passed in from the queue as a transaction item. In two separate workflows I use convert.ToString(out_TransactionItem.SpecificContent(“Subject”))…but it only works in one of the workflows. In the other it says “The given key was not present in the dictionary.” I understand this has something to do with the transaction item but I don’t understand what I should be changing. Thanks


are you sure the Subject is filled in each queue item (Im assuming transactionItem is from a queue)
you might need to check if -> out_TransactionItem.SpecificContent(“Subject”)) is nothing
are you sure your TransactionItem is filled in at the current position of the workflow?

I would put a breakpoint on the action and check the out_TransactionItem in the locals view.
(if it is not visible due to beeing an argument you can assign it to a normal variable and check the variable instead. (assign -> TEMP_ITEM = out_TransactionItem))

look at the solvation of this topic:

I wrote out the Subject and it came back with an error saying it wasn’t present…so I guess there is no value for the Subject. But I do know that the the queue item is present because I am able to write out the Sender of the email (transaction item). So why would the Subject come back blank if it is not?

so convert.ToString(out_TransactionItem.SpecificContent(“Sender”)) is working? (in that exact sequence)
and you are sure there is a Subject in the queue item?
also no typo’s? (because “The given key was not present in the dictionary.” looks like or there is no Subject… )

I would try to see the out_TransactionItem in your locals screen via the debugging.
(can’t make a quick example with a queue item… )

I actually ended up figuring it out. I was missing an argument being passed through at one point. Thank you for your help.