Orchestrator Queues uploading invoice data from Extraction

Afternoon All
I’m having some issues with uploading to the queue in Orchestrator.
image
I’ve tried 2 ways

  1. Adding each variable to a collection and then using that collection in the Add to Queue and I get the below
    image

  2. Using the straight Add Queue Item, adding each item argument but I get the below.

RemoteException wrapping System.ArgumentException: Could not determine JSON object type for type UiPath.DocumentProcessing.Contracts.Results.ExtractionResult.
at Newtonsoft.Json.Linq.JValue.GetValueType(Nullable1 current, Object value) at Newtonsoft.Json.Linq.JContainer.CreateFromContent(Object content) at Newtonsoft.Json.Linq.JProperty..ctor(String name, Object content) at UiPath.Core.Activities.QueueEngine.GetInformationAsJson(Dictionary2 information)
at UiPath.Core.Activities.QueueEngine.BuildAddQueueItemContent(String queueName,
String priority,
Dictionary`2 itemInformation,
String reference,
DateTime deferDate,
DateTime dueDate)
at UiPath.Core.Activities.AddQueueItem.CreateMessageContent(NativeActivityContext context,
String robotKey)
at UiPath.Core.Activities.BaseQueueActivity.BeginExecute(NativeActivityContext context,
AsyncCallback callback,
Object state)
at UiPath.Core.Activities.AsyncNativeActivity.Execute(NativeActivityContext context)
at System.Activities.NativeActivity.InternalExecute(ActivityInstance instance,
ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,
BookmarkManager bookmarkManager,
Location resultLocation)

Any help appreciated

Depending on how AddQueueItem is set up, you may have to use an intermediate variable, but you should be able to leverage LINQ. IEnumerable has a .ToDictionary extension. Here’s the raw-code version (converting from C# so this may not be entirely accurate. You may also need to cast your ICollection to IEnumerable first, but I’m not sure.).

ToValidate.ToDictionary(Function(x) x.SomeKey, Function(x) x.SomeValue)

I’m no too sure on the Newtonsoft error. Finding this same error for other projects required an update to the underlying type (in this case, an ExtractionResult.) Those could be isolated issues though.

So I converted in the Add QueueItem activiting the 4 items to string using serialize. This allowed me to upload to orchestrator queue.

But now how do I changed them back int he next workflow to the Variable types i need them to be? string to DocumentObjectModel for instance?

1 Like