How to add queue items with "advanced" types

studio
variable

#1

Using the Add queue item, i try to add a variable of type List.
When doing that i get an exception saying: "Add queue item : Some values used for input might be in an incorrect format. Please note that not all properties are compatible with older Orchestrator versions"
I also tried with the type String[], and got the same error.
“Normal” values like String works fine
image

Am i doing something wrong, or is it a limit to queues that you can only add simple values?
If yes, then why do i get the option to select other values in the dropdown?

My Current challenge is that i want to add a dynamic number of variables to 1 queue items.
I have a folder with 1 excel file pr “job”. there can be multiple jobs in the same folder.
Each job can also have 0-5 PDF files that is in the same folder with the same name as the excel file.
What i’m trying to do, is adding a queue item with 2 variables: “Keyfilename” and "FileList"
Keyfilename is a String that contain the name of the excel file, and the fileList is a List(of string) that contains the PDF files.
Now i thought i could add the keyfile and the filelist to a queueitem, but as explained above, this dosen’t seam to work.
image
(Mad paint skills :smiley: )


#2

Hi Konrad,

Other folks may be able to correct me on this, but I’ve also attempted to upload arrays and the like without success. I don’t believe you are able to.

I believe the reason you can select advanced types is because it is a generic drop down selector within the windows workflow manager.

I’d love to see a way to upload arrays and collections though.


#3

You can do it as json strings - add JsonConvert.SerializeObject(yourCollection) and then deserialize when getting it back.
Anything that is serializable and then deserializable with json can be used that way.
For other things you might consider binary serialization and store the bit stream for it, if json messes it up.


#4

That sounds like a good temporary solution.
Do i need to do something special to get it to work?
image

image


#5

Hi Konrad,

If you create a variable of type jsonconvert, this should resolve your issue.

I’m trying the same workaround although I have issues with orchestrator (related to my environment and not something to worry about)

Thanks


#6

Import Newtonsoft.Json namespace.


#7

I converted a DataTable to Json but then when im use deserialize, it creates an object of type Newtonsoft.Json.Linq.JArray.
(“Assign Deserialize Json : Unable to cast object of type ‘Newtonsoft.Json.Linq.JArray’ to type ‘System.Data.DataTable’.”)

Shouldn’t it create a DataTable object back again? Can someone please help me and explain what is going on here? From my understanding, what the converter should do is create a json string from a datatable and then create a datatable from a json string. Why is this not happening?


#8

DeserializeJson creates json objects.
To deserialize as specific type, use JsonConvert.DeserializeObject(Of yourType)