Customize Table Extract as per our requirement

Hello,

I need to extract the required data from Table Extract

Problem: Using Table extract I get 10 profile links from LinkedIn
but as per my requirement, I need only 8 from 10, and another time when the loop runs, I need to extract 5 out of 10.

image

I have a total of 10 Links which I have extracted from Table Extract but I need only 8 on which perform actions. if i change 8 to 6 at that time table get only 6 link for me
How can i do this thing?

Thank you!

Hi,

Need urgent help,

@ashokkarale @AJ_Ask @Gautham_Pattabiraman @sanjay3 @balupad14 @lrtetala @RAKESH_KUMAR_BEHERA

Regards
Akhil

1 Like

Hi @Anonymouss

Try this

YourDataTable.AsEnumerable().Take(8).CopyToDataTable()
YourDataTable.AsEnumerable().Take(5).CopyToDataTable()
YourDataTable.AsEnumerable().Take(6).CopyToDataTable()

Cheers!!

Hi @Anonymouss ,

Is there any criteria you need to use for picking 8/10
Or the first 8 from 10 would do.?

@Anonymouss,

For this you can keep the Max Row property dynamic.

Here is sample solution code.
ConditionalDataExtraction.xaml (15.6 KB)

Output:

Thanks,
Ashok :slight_smile:

Hi @Anonymouss ,

Step 1 : using assign, assign the number of rows you want to select to a int32 variable.

Step 2 : use the below statement to select the required number of rows.( assume n as your int32 variable.)

YourDataTableVar.AsEnumerable().Take(n).CopyToDataTable()

Hope this helps you out.!!

Please let me know if you need any condition with you want to pick the records will give you an alternative method.

Thanks,
Gautham.

Appreciable,

@lrtetala @ashokkarale @Gautham_Pattabiraman
if we need 2 candidates instead of 8 at that time I have to change my code, in the UiPath

I want like this, If I enter 2 instead of 8 in my ExcelSheet at that time my loop runs only 2 times and extract only 2 profile from LinkedIn via Table Extract

Might be my problem is understandable

10 is also not any criteria, if in the ExcelSheet candidate number is written as 5 at that time table extracts only 5 and fetch data of all 5 five candidate

if we change in excel file → candidate number 5 to 1 at that time it run only once

Hi @Anonymouss ,

That is Why I suggested you assign the number of records you want to in an Int32 variable and use that inside take() method or you can assign the variable to the max row property as @ashokkarale suggested.

Thanks,
Gautham.

Use a Read Cell, Assign the value to an Int32 variable and pass it on in either of the methods.

It should work fine.

will you make sequence of this for my better understanding.

Thank you.

@Anonymouss,

It’s easy to add this logic also to my earlier logic.

Input:
image

Solution:

Sample Code:
ConditionalDataExtraction.xaml (15.6 KB)

Output:

Thanks,
Ashok :slight_smile:

1 Like

This solution is working.

@ashokkarale @Gautham_Pattabiraman

Thank you
Akhil

2 Likes

@Anonymouss ,

ForumQuestion.zip (10.1 KB)

Sample sequence using another method.

Please mark the response which helped you out as solution so that the thread gets closed.

Happy Automating…!!

Thanks,
Gautham.

1 Like

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