How to check the queue item based on the condition?

HI All,

I need to check the queue item count with the condition as below:
I need to check whether the queues contains the word “NY” is greater than zero.
in simple in_transactionitem.contains(“Cloumnname”).contaiins(“NY”) is greater than zero or not.

how to achieve this??

@Yoichi
@ppr
@vishal.kp
@gok
@ushu

Hi @Vrishchik - Can you try this

Take if condition to check, queue date contains NY

If condition - QueueData.SpecificContent("Test").ToString.Contains("NY")

Then >> QueueData.SpecificContent("Test").ToString.Count

Else >> Required steps/Nothing

Hi @Vrishchik

How about the following?
If your queue item is type QueueItem then try with

in_TransactionItem.SpecificContent("yourKey").ToString().Trim().ToUpper().Contains("NY")

If your QueueItem is type DataRow then try with

in_TransactionItem("YourColumnName").ToString().Trim().ToUpper().Contains("NY")

Regards

will equation gives the count only for NY??
Because that column there are multiple states like NY(Newyork), TX(Texas) etc

I need to take the count for each individual state

@Vrishchik - I am assuming it’s a queue date looking at in_transactionitem

To understand the above one, can you share the screenshot of your input format

@Vrishchik - Sound like for Guarantor State field it could be NY (NewYork) or TX (Texas) or some other

To check Guarantor State field contains NY or no, you can use if condition

If condition - in_TransactionItem.SpecificContent("Guarantor State").ToString.Contains("NY")

Then >> Assign activity, Variable of type Integer DataCount = in_TransactionItem.SpecificContent("Guarantor State").ToString.Trim.Count

Else >> Required steps/Nothing

@Vrishchik

If I am not wrong you want to check number of queue items containing NY is greater than zero or not…if yes try the below

Use get queue items to get a set of queue items and say output is quls

then quls.Where(function(x) x.SpecificContent("Guarantor State").ToString.Contains("NY")).Count>0

Hope this helps

cheers

sounds like you are interested on a report of multiple QueueItems within a particular period.

Retrieval:

  • Orchestrator API
  • Get Queue Items ← s

Calculation:

  • one of many options: LINQ and Grouping the data (Group by)

Imagine there are 20queue items contains
10 queue items contains “NY” then the total count is 10 which contains NY.
and reamining 10 queue items contains “DE” then the count of DE is 10.

I am expecting output count for NY is 10

@Vrishchik

That is what exactly the above query output would be…It gives you 10…first use get queue items to get all the queue items into a variable

cheers

Getting error specific content is not a member of UiPath.core.Queueitem

may I know what is the quls ??
whether it is the output of get queue item??

@Vrishchik

Yes thats the output of get queue items…

and I have typed wrong its specificContent …there was an extra e can you please correct it.I Updated the formula above

cheers

Hi @Vrishchik ,

Try the following:

(from item in QueueItems where item.SpecificContent.ContainsKey(“Guarantor state”) andalso item.SpecificContent(“Guarantor state”).ToString.Contains(“NY”) select item).Count

Regards,

Thank you it is working fine as expected.

1 Like

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