ItemInformationCollection example

Hi, i was reading this:

And regarding “ItemInformationCollection” it says that you can pass “Dictionary<string, object>” variables.

What do I need to put into that Dictionary? Can someone provide an example?

Thanks.

1 Like

The dictionary item doesn’t work that well. I would highly recommend to parse your dictionary as a json text and send it to orchestraror. While retrieving you can again de serialize it to dictionary or any other two-dimensional variable/container.

Below thread has explanation with options

Why do you say it doesn’t work that well? It works great for me. No reason to overcomplicate by adding conversion steps.

You can put anything you want in that dictionary.

Whatever dictionary (and its values) you put into the queue item, will be what you get back when you Get Transaction and then use yourtransactionvar.SpecificContent

The one catch is you can’t do complex datatypes like datatables, etc. but you can do arrays, lists, timespans, int32, double, etc.

For example, if you do…

myDict = new dictionary(of string, object)
myDict(“Name”) = “Paul”
myDict(“Age”) = 32
myDict(“City”) = “Miami”

Then use Add Queue Item and pass myDict to ItemInformation Collection.

Then use Get Transaction and store the transaction in a variable named myTrans…

myTrans.SpecificContent(“Name”).ToString will return Paul
myTrans.SpecificContent(“Age”).ToString will return 32. If you need it as an integer you would reference CInt(myTrans.SpecificContent(“Age”).ToString)
myTrans.SpecificContent(“City”).toString will return Miami.

Remember that you have to control the output datatype, because it is dictionary of string, object - so the value you get back is an object and you have to convert it to the datatype you want.

Oh I thought I had to pass like a dictionary of configuration or something like that haha. Thank you very much!

The dictionary is just the name/value pairs you need for the transaction. The data.

Configuration for the queue item is in the properties of the Add Queue Item (or Bulk Add Queue Items) activity:

image

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