I have a single transaction process which I am having difficulty with. I have tried changing GetTransactionData.xaml within Reframework but receiving an error.
This post Set transaction data for linear process said to set out_TransactionItem = 1
I tried that but UiPath is throwing “Value of Type Integer cannot be converted to UiPath.Core.Queue item” error.
Within GetTransactionData.xaml I have an if activity which is set to (if):
in_TransactionNumber = 1
Assign: out_TransactionItem Value: 1
How can i fix without changing reframework states? I need to keep GetTransactionItem.xaml
The error “Value of Type Integer cannot be converted to UiPath.Core.Queue item” means that you are trying to assign an integer value to a variable of type UiPath.Core.QueueItem. This is not possible because the two types are not compatible.
To fix this error, you need to cast the integer value to a UiPath.Core.QueueItem type. Casting is the process of converting one data type to another.
To cast the integer value to a UiPath.Core.QueueItem type, you can use the following code:
out_TransactionItem = new UiPath.Core.QueueItem(in_TransactionNumber.ToString());
Where out_TransactionItem is of type UiPath.Core.QueueItem type
The new keyword is used to create a new instance of an object. The UiPath.Core.QueueItem() constructor takes a string value as input and creates a new UiPath.Core.QueueItem object from the string value.
Once you have cast the integer value to a UiPath.Core.QueueItem type, you can then assign it to the out_TransactionItem variable.
An updated version of your GetTransactionData.xaml workflow:
If
* in_TransactionNumber = 1
* Assign
* Value: new UiPath.Core.QueueItem(in_TransactionNumber.ToString())
* To: out_TransactionItem
End If
This code will cast the value of the in_TransactionNumber variable to a UiPath.Core.QueueItem type and assign it to the out_TransactionItem variable. You can then use the out_TransactionItem variable in your linear process.
Note: You do not need to change any of the Reframework states to fix this error.
I have tried to implement but now receiving a new error:
“Compiler error encountered processing expression new UiPath.Core.QueueItem(in_TransactionNumber.ToString) too many arguments to Public sub new”
I like this solution but cannot get to work. @ppr do you know how to fix?
If
* in_TransactionNumber = 1
* Assign
* Value: new UiPath.Core.QueueItem(in_TransactionNumber.ToString())
* To: out_TransactionItem
End If
Receiving error:
“Compiler error encountered processing expression new UiPath.Core.QueueItem(in_TransactionNumber.ToString) too many arguments to Public sub new”
When you mentioned casting the integer value to a UiPath.Core.QueueItem type, is there no way to fix that code to assign an int / string to a queue item directly to hold it locally?