Solve this scenario

Hello everyone in one file i have around 10,000 records
first i have to filter the column Engage value to Pay then i have to fetch the invoice no. from 2 columns journal description and line description.

But here I am facing 1 issue.
what i have observed in 1 file with 10k records after filtering Pay values I am using if condition as per my scenario but all the conditions goes to else condtion.

Then i check in my file out of 10k records on 20 records fits in my conditions, How can i code my bot to stop the unnecessary items.

@Luffy

Can you please explain a little more one thing is contains invoice will work only if invoice is all in small letter

You can try like this

Currentrow("ColName").ToString.ToLower.Contains("invoice")

Cheers

@Anil_G To be more precise " Invoice " this is the correct keyword for journal description.
“||” is used for line description.

@Luffy

And what is goin gwrong in your flow?

What is the data …because without those it is difficult to comprehend on what the issue is

Cheers

@Anil_G my flow is working fine and generates correct output until i encountered this file which contains around 10k row items.

out of 10k row item only 20 row item contains keyword “invoice” and “||”.

so instead of these 20 rows remaining rows goes to second if condition - else state (which is basically unnecessary time consuming process).

So what i need is i want those remaining condition to be skip before execution

Hey @Luffy,

Try using a filter activity where Journal description and line description are column names and operator is contains with value set as invoice and || respectively .

Another approach is using linq, where an assign activity is used and left side is dt1 and right side is

(From row in dt1.AsEnumerable
Where row("Journal Description").ToString.ToLower.Contains("invoice") or row("Line Description").ToString.Contains("||")).CopyToDataTable 

This should be done before the if condition which screenshot you have attached

@Quenton_Wayne_Rebello I tried but key Invoice can be in different line of journal description and || can also be in different line.

Means mostly both they keyword are in different lines.

You can use an or condition, so it will indicate that either it should have invoice, || or both

@Luffy

You can use filter datatable activity and filter the datatable with contains on invoice and || and loop only the filtered table

This way which does not contain are not even looped

Hope this helps

cheers

Hey @Luffy,

As per the code shared previously :-
(From row in dt1.AsEnumerable Where row("Journal Description").ToString.ToLower.Contains("invoice") or row("Line Description").ToString.Contains("||")).CopyToDataTable

It generates the below results,

image
Input DataTable

image
Output DataTable

thanks got the solution :smiley:

1 Like

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