Detect only full fields in the transaction item

I have a queue which is filled with QueueItems. After filling, each field is either written with alphanumeric, it is null or Empty.

Currently I detect the number of full fields with the lambda

TransactionItem.SpecificContent.Where(Function (x) Not IsNothing(x.Value)).Count

However, this also counts the Empty fields. What is the way to read only the number of full fields in the TransactionItem?

image

can you Trim x.Value and check if it works?

@Kytyzow ,

Try checking for empty strings also.

TransactionItem.SpecificContent.Where(Function (x) (Not IsNothing(x.Value) and Not String.IsNullOrEmpty(x.Value) )).Count

Unfortunately, this did not work. In itself, the field content is trimmed, but since the field is already empty, this does not fix the problem.

Unfortunately, that was not the solution either.

My goal was to recognize before the loop how often it may run. Now I used a head based loop and check (with SpecificContent) right at the beginning if the content is Empty or Null. The loop now runs as long as the fields are not empty.

Thanks for your suggestions!

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