Lesson Orchestrator 2018.2 - Practice 8 - TransactionItem.SpecificContent( "" )

I am learning with " Level 2 - Orchestrator 2018.2 Training" course.

Lesson Orchestrator 2018.2 - Practice 8

I have gone through the steps that they have provided us to follow. However, I can manage to get Queue in the current project with transaction but when i fetch the TransactionItem.SpecificContent( “” ), It will throw me an error.

Message: The given key was not present in the dictionary.

Exception Type: System.Collections.Generic.KeyNotFoundException

The key that i am fetching in SpecificContent is available in QueItem in Orchestrator(See below image).

I am using following syntax in my project.
cint(TransactionItemData.SpecificContent(“Income”))

Again, I have found one point that in step 5 :
Click the TransactionItem field and press Ctrl K to create a new variable of type Transaction Item.

But when i am creating the variable using ctrl + k, it was created of type “QueueItem” instead of “TransactionItem”. And when i am trying to change the variable type to “System.Transactions.Transaction”, it will throw me an error.

Kindly help me out with this, I am stuck in this tutorial.

Try this

  1. Clear you queue
  2. Again push items in queue
  3. Run your program

Thanks,
Prankur

Hi prankurjoshi,
Thank you for your prompt response.
I have tried this by removing the queue and again push the item.
But still i am facing the same issue.

Firstly, the datatype of “TransactionItem” needs to remain QueueItem to process items from an Orchestrator queue, as .SpecificContent is a function which grabs elements or variables attached to a single queue item.

Secondly, for the “Get Transaction Item” activity, have you correctly configured the input queue to match the name of yours that you created?

Lastly, is your “TransactionItemData” the name of the variable you’re using for the TransactionItems or did you create two variables - one TransactionItem and one TransactionItemData? If you did create 2 different variables, seems like the problem may lay here & be resolved by changing the assigns to :

cint(TransactionItem.SpecificContent(“Income”))

1 Like

You should mention what specific content needs to be read from queue.

Do i need to create TransactionItem and TransactionItemData two separate variables?
Currently i am having only one variable named TransactionItemData of “QueueItem” type.

if i need to use TransactionItem, then what is the type of this variable and what value should be assigned in the this variable.

No, you only need a single one: “TransactionItem” as data type: QueueItem.

Could you upload your workflow?

What you got is correct, it should be QueueItem type only. Dont change that.
So the output variable of your GetTransationItem activity is now TransactionItem which is of type QueueItem

Now that you have done the above, next in the assign to the int32 variable you have, say income

income = cint(TransactionItem.SpecificContent(“Income”))

This should solve your issue

@nadim.warsi He’s using “TransactionItemData” in place of “TransactionItem” in his code. Should probably leave it as is since “TransactionItem” is a predefined variable & argument in REFramework.

Got it @Jon4than

Then the question, @Arpit_Patel are you using REFramework to build your solution?

@Arpit_Patel Did you get the solution for your query? I’m also getting the same error when I run the workflow

I’m also having the same problem. I tried Nadim’s fix of cint(TransactionItem.SpecificContent(“Income”)) but this just made the error change to "Conversion from String Incomes to Type Integer is Invalid

Hi @rahulsharma,

In the assign activity you have the value cint(TransactionItem.SpecificContent(“Incomes”))
That error message means that the TransactionItem does not have a a field names “Incomes”. Maybe the extra “s” at the end?

Please check in Orchestrator, queue names “Queue” and make sure the string you use for SpecificContent is exactly as in transaction item details -> Specific Data.

How can I assign to a variable the TransactionItem.SpecificContent( “Mail” ) if “Mail” is of System.Mail.Mailitem type ?
Something like this Mailitem = …TransactionItem.SpecificContent( “Mail” )…

How was this resolved. I am getting same error