GetTransactionData not working properly

I am running into issues when running GetTransactionData (part of Assignment 2 of advanced RPA Developer). Can you please take a look at the attached .xaml file and let me know what is wrong.

GetTransactionData.xaml (12.0 KB)


May i know what error are you getting here ?

And also show me screenshot of how you wrote expression in IF condition.

@lakshman -
I attached the workflow for GetTransactionData in the original post.


Currently i don’t have system. That’s why I am asking provide screenshot of it.

Here’s a screenshot, @lakshman
out_transactionItem and out_transactionID are set as below:
out_transactionItem = in_WIList(in_TransactionNumber - 1)
out_transactionId = out_TransactionItem(“WIID”).ToString

Is out_TransactionItem of type Queue Item?
Your IF condition does not seem right, cause you shouldn’t be checking if the transaction number is less than the count as there is no reason to check if you are at the last item. This is because when you use Get Transaction Item, it will stop when there are no more items. So, the condition would be more like IF out_TransactionItem isNot Nothing. - TransactionNumber is really just an analytical value with no real use other than to see how many items were performed on a robot.

Also, your Write Line is wrong, cause out_TransactionItem is not a string (or maybe it is?). If it is a Queue Item or a Data Row, you need to use a key with it or the reference to see the value of the item. For example, out_TransactionItem("WIID").ToString

You could also look at the GetTransactionData as provided in the REFramework template from Studio by creating a new project from Template.

Sorry, as I did not download or view your workflow file.

If you provide slightly more details at how you are using the TransactionItem (using the Queue or not?) and what is “not working”, we can help better.


@ClaytonM - Thanks. I am not using Queues anywhere. I’d like to stick to DataRows since Queue Item types were throwing all sorts of errors. Also, I had deleted the Get Transaction Item activity - is there a way to use Get Transaction Item without using Queue Items? I am not sure where the loop is to iterate through all the WI5 elements since the process reads in the first WIID of the datarow array (WI5List), prints it and then errors out.

Since you are not using Queues, TransactionItem should be of type Data Row, I think. Then, you will use the column names as the key throughout your code. For example, out_TransactionItem("WIID").ToString

Then, you would use Extract Structured Data (which I assume you did already) and store that to a Data Table. You will also need to surround this by an IF that checks if the data table or transaction item is something, so it only gets the data one time.
For example,

IF in_WIList isNot Nothing
   Extract Structured Data

(you may have already done this and slightly different that this example)

Then, to assign each item to TransactionItem, use an Assign activity with the TransactionNumber as the index.
For example,

Assign: out_TransactionItem = in_WIList.Rows(in_TransactionNumber)

(if in_WIList is of type Array of Rows, then take off .Rows) EDIT: also, this replaces the Get Transaction Item activity

In order for this part to work, in_TransactionNumber should be incremented ( + 1 ) at some point after each transaction is complete (probably in the Set Transaction Status workflow)

To verify, each transaction is being pulled, in a Write Line, output some of the columns, like out_TransactionItem("WIID").ToString
If I remember right (I have a horrible memory lol), the WIID column will be used for your out_TransactionID, which is only used for analytics to identify each unique item in the logs.

And, you want to make sure that TransactionItem is of type Data Row everywhere it is used (such as the arguments for all your workflows)

The main thing is, you should be simulating exactly what the REFramework is doing, since that is what you are working from initially. However, only difference is that you need use the TransactionNumber as the index and use an Assign to pull in the TransactionItem to a Data Row rather than Queue Item.


1 Like

Hi @ClaytonM - Appreciate you taking the time and effort to go into these details. Thank you. I noticed that I have not used Set Transaction Status anywhere. The instructions in the assignment asked to remove all the Set Transaction activities from the Set Transaction Status.xaml file and so I did. (Screenshot below).
I don’t know where Set Transaction Status gets invoked in the workflow. Is it possible for me to email you the files from my project ? I have been going back and forth on this assignment for a while and feel like I am only half-way there. :frowning:

I feel like you need the Set Transaction Status workflow cause that’s also where the RetryNumber is incremented if it isn’t passed the MaxRetryNumber. Maybe I’m not a good person to ask about the assignments, though.

Essentially, the SetTransactionStatus.xaml gets invoked in the Finally part of the Try/Catch surrounding the Process.xaml invoke (inside the Process state). This allows you to increment the retry number when there was an application exception (and not increment the TransactionNumber so it retries the same item) and if it gets there and there was a BusinessRule Exception or MaxRetries were hit, then the retry number gets reset and the TransactionNumber increments so it gets to the next item.

If you have this workflow, you can see what I mean, or create a new Project using the REF template. Here is a snippet though:

And, it checks if the transactionItem is a Queue Type before using the Set transaction status activity, so there are no problems there. You can also set a status in the Data Row for your transaction if you would like to.

Like I said, though, I’m not sure why it would ask you to remove this important part. Either way, you do need to increment the TransactionNumber, otherwise, there’s no way to get to the next item. - This should happen at some point after the Process.xaml I think. The retry mechanism is useful too, cause errors are actually pretty common on most applications given the unpredictability of a Windows environment and the random functionality of some applications.


Thanks, @ClaytonM.
I inserted SetTransactionStatus in the catch block as you suggested.
With TransactionItem set to DataRow type, I get the following compiler error within the SetTransactionStatus workflow. Shown below.

I deleted the sequence in the “Then” part of the workflow as recommended in another post. Compiler errors went away but it looks like I am getting stuck in GetTransactionData. Attached is the logs file.
output.txt (1.7 KB)

Judging by this, it’s hitting the end condition that checks if you have any more transactions:

I suggest going to this Log message and checking the conditions that cause it to get to this point.

Also, there was an error on your Logoff, so I would suggest checking that too, assuming the application was opened successfully and the logoff button should exist.


So I went past that hurdle after some much needed debugging (lol), I stumble upon the part where the script attempts to update the Work Item with the hash code. Error with the selector.
Screenshot below. Thanks again!.

Fixed the selector through UI Explorer… Let’s see what errors out next. :slight_smile:

1 Like

As expected, another selector related error. This time it’s the confirmation message that pops up and the goal is to click ‘OK’. Throwing an error with the selector there.
Here’s a screenshot with the selector.

Ended up using “Send Hotkey” instead of Click activity. And it worked.
Now I am in the SetTransactionStatus workflow and I get this message:
Invoke SetTransactionStatus workflow: Object reference not set to an instance of an object.
Guess I have a null pointer exception.

Said too soon. Ok confirmation window doesn’t seem to go away after using send hotkey. I’m not sure what’s going on. I know in some posts they recommend using IE vs Chrome. I’m using Chrome. Isn’t there any alternative to take care of this without switching to IE? @ClaytonM


Feel free to reference my workflow for the Update Work Item task. It uses IE, but it uses selector interaction so I think the selector should be same in Chrome.
ACME_UpdateWorkItem.xaml (15.4 KB)

It uses an Element Exists to see if it was updated sucuessfully, then makes a decision to Log the success or throw an exception message.


Hey @ClaytonM - thanks for sending the .xaml file. I haven’t been able to get past that phase but the logs show an error in the SetTransactionStatus workflow inside the success loop. It appears it’s looping more than once due to the second print statement (Inside the STS success loop).
Attached is the output. Please advise.

output.txt (1.5 KB)