Get transaction item count and log it into excel


The problem here is the success items will have Successful and not sucess as status…that is the reason I asked multiple times if the status is being logged

Please use currentitem.status.Equals("Successful")


1 Like

Still same issue.

Now i have changed it to Succeful


I have updated to not current item.Status.equals(Successful)

But the issue is i had 3 items and now it has it in excel 3 times. It should log only once and give the status

It should only once the count should be 3 and status


You are looping through all items so getting 3…if you want in one line then what you need as start and end time? As it would be different for eqch item…and exceptions also will be different for each failed


Yes I need in one line if all the transaction are success then success and if Item is failed then status as failed with exception message.

Above I’m only getting success even if failed.

I saw your previous post that you shared I will try that condition in if and update you.

Can you share how I can loop for one line?

If the item is 3, it should only 3 in one line and status has fail or success


Multiple failures can be for multiple reasons …how do you want to handle them…and for start and end time how will you get the consolidated value?

If you can explain this requirement will give the changes accordingly


Lets say there are 3 items in queue.

If the scenario is “Success”

If the scenario is “Failure”

I want them all in one line.

I dont want 3 different lines for every item. I just want final execution status for all.

If failed in between then failed or successful then success.

For start time and end time I will it get from variable from user and ask them to pass.



Say 3 items failed…with 3 difference exception messages then how to give them?

If you need both separate only in two lines max one for success and other for failed

then use same get queue items two times…once for success and get the count

then for failed and get the count and for exception message String.Join(",",qulistitems.Select(function(x) x.ProcessingException.Reason))

with the above all exception messages will be separated by comma and given as one string

for this use two difference get queue item queues one for success and other for failed


1 Like

Basically in our case script will end if it is failed we will give in built Retry mechanism.

So we can just log the status as Success and Failed

We dont need messagw for every single item we just need message and count of items.

If possible at which item number it failed will be of great help.



for count has given it already above…please check…if you dont need message and time at all I am not sure why you were askign this all long

item nummber if it is there in the specific content you can get it

quitemls.OrderBy(function(x) Cdate(x.StartTransactionTime)).Last().SpecificContent("Item Number").ToString


Sorry, If I’m not very clear with my statement

In the above excel,
There were 3 items in one process, now what it did was it logged it 3 times with 3 different exception messages. I don’t want that. Because as you can see the count is now 9 if we add.

If the process is run another time then it should append and so on

It should write in one line with final exception message. As I said, script will end once it fails so I need the failure exception message.

What I want is this in below excel format.
Count -3
Status - Failure
Exception - Failure Exception Message
All this in one line. It shouldn’t write for every single itemis what I meant.

Sorry for not making it clear before, will make sure I make my requirements more clear.

Regarding time I just confused between process time and queue time.



Please try the above…the above does not need any loop as we are using oonq and you need only counts

For every single item if it writes then it will be 9…if you need consolidated then it will be 2


1 Like

Thanks for your time @Anil_G I got the understanding.

Thankyou for your time

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.