I need to check if an item is in the queue item array. How do I do this without using a loop?
Can you specify what exactly you want to check, whether it is a field value inside queue item or if a field name ?
Regards,
It is a field value inside the queue item
Hi
Get the queue items with GET QUEUE ITEM activity where u can use some filter strategy u need to check whether a queue item is there or not without looping
If the output has some value then it is there in that queue
Cheers @redanime94
@redanime94 ,
Try the following:
Replace the FieldName and ValueToCheck
(from item in QueueItems where item.SpecificContent.ContainsKey("FieldName") andalso item.SpecificContent("FieldName").ToString.Contains("ValueToCheck") select item).Count
Here, if the count is greater than 0, you can confirm that the value is present in the queue items.
Regards,
I am getting this error: āAssign: Expression Activity type āVisualBasicValue`1ā requires compilation in order to run. Please ensure that the workflow has been compiled.ā
Check the double quotes, it should be straight instead of the curved ones.
This-> "
Regards,
It worked⦠but I am getting a zero result is that .ContainsKey(āFieldNameā) the same value as the .SpecificContent(āFieldNameā), i.e. say I am looking for a āCustomerNumberā then the FieldName in both should be CustomerNumber?
Yeah field name both you should provide the name like āCustomerNumberā
Regards,
I am getting zero result
This is what I have done:
The arrMatch is looking for the latest run of the itemā¦
@redanime94 , for example the below shown image the Custom1 is the filed name and the d is the value hence, the expression will be:
(from item in QueueItems where item.SpecificContent.ContainsKey(āCustom1ā) andalso item.SpecificContent(āCustom1ā).ToString.Contains(ādā) select item).Count
Regards,
(from item in arrMatch where item.SpecificContent.ContainsKey(āCustNameā) andalso item.SpecificContent(āCustNameā).ToString.Contains(āstrCurrentCustNumberā) select item).Count
I guess this is a variable you are passing? if it is then you need to avoid the quote.
Regards,
Hmmm - posting the image I think I know where the error isā¦
Yup thatās a variable being passed
Itās working now - I am getting a value. Thanks for the help.
I hope you got the error fixed, variables should be passed without double quotes.
Regards,
Yup itās working. Thanks for that.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.