Add DataTable to Queue

I have a list of excel files, that I want to add to an Orchestrator Queue but I am getting the following error.

SendItems.xaml: Compiler error(s) encountered processing expression "sheet". Value of type 'System.Data.DataTable' cannot be converted to 'System.Collections.Generic.Dictionary(Of String, Object)'.

SendItems.xaml (5.8 KB)

Hello @SRoy

Welcome to the community!!! :smiley:

Im unable to check the workflow at the moment. But Based on the error I think you have not specified a datatable type variable for the read range output property. Output property only supported datatable type variables. Can you check it and let me know if it solves the problem

@Lahiru.Fernando thank you for your prompt response. I am including a screenshot of my workflow for you to take a look.

Also, the properties of Add_Queue_items activity

add_q_item_prpperties

1 Like

@SRoy Thank you for sharing the screenshot…

Can you select add queue item activity and open the collections property to see how you have configured it?

add_q_item_prpperties

Can you also expand the collections property there. Wanna see what is passed to the queue before giving you my thoughts :thinking:

Hi @SRoy,

The only data type a queue accepts as parmeters is String. Hence, you can serialize the DataTable & insert it to the queue. Then fetch it from the queue and de-serialize it.

Regards,
Nithin

1 Like

you mean this ?

screenshot_01

1 Like

Thank you for your prompt reply. I had previously done this exact step earlier using the same excel files and the workflow executed just fine.
Do you think this error maybe because there may have been a change in the contents of the excel file ?
@Lahiru.Fernando @Nithin_P

Nope… the item information property just above the one that you get the error…

In addition to that, check this…

See… the sheet variable is of type datatable. But the item in information collection only accepted dictionary data type variable…

You can see more info on that here

Why I want to see that other property is to understand what you are trying to add to the queue… can you explain that so I can give a better approach for this?

@Lahiru.Fernando @Nithin_P

1 Like

Cool… so here is the thing.

When adding data to the queue, you have to use the item information property of the add to queue activity…

So in that collection window, add the values you want to add to the queue as arguments.

Add the it

Argument name, data type and the value… just remember you cannot add datatable variables to the queue. But you can add list collections

If you want to add the rows as queue Items, you can do that with the Bulk Add Queue Items activity. More about it here.

If your requirement is push the whole datatable to queue, then use this serialize deserialize workflow:

Regards,
Nithin

2 Likes