How to get data from datatable according to the content

@Lakshay_Verma

@manoj2500

Click on import and add assembly reference System.data.datatable and System.Data.DataSetExtensions

If that does not work downgrade your UiPath.System.Activities to 20.4.0

For the datasetextensions have a Look here

Ensure system.linq, system.linq.expression is imported (Imports Tab, Close to variable panel)

Shift Statement from
in dt to
in dt.asenumerable

Give a try and Let US know the feedback

2 Likes

@ppr Thanks for adding this.

@manoj2500 You have to follow above steps.

@Lakshay_Verma i added it manually now i am getting this error

i am adding the xaml Main.xaml (8.7 KB)

@manoj2500 For Handling that error, you might need to check this post :

@Manoj2500

sorry, it’s a typo… i have typed massage instead of message… Please correct this

dt= (from dr as datarow in dt where dr.item("message status").tostring.equals("error message 51 retry") select dr).copytodatatable

2 Likes

HI @manoj2500

Check the below workflow for the same. It is giving the ticket numbers that matches message status as – error message 51 retry.
MainPratik.xaml (9.3 KB)
Forum _ Manoj.xlsx (9.5 KB)

Mark as solution and like it :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

3 Likes

can you help me what i need to do if i need to remove this one need other status types in datatable

@manoj2500

dt= (from dr as datarow in dt where dr.item("message status").tostring<>"error message 51 retry" select dr).copytodatatable

it giving me all tickets output screenshoot

@manoj2500

write range in sheet 2

@Lakshay_Verma i am creating a new excel and passing thru write range

@manoj2500

(from dr as datarow in dt where not dr.item(“message status”).tostring.equals(“error message 51 retry”) select dr).copytodatatable

Can you try this.

1 Like

Can you try the below code?

DT = DT.AsEnumerable().Where(Function(dr) dr.Field(Of string)("message status").ToLower().Equals("error message 51 retry”)).CopyToDataTable()

hi @Lakshay_Verma @JithinGangadharan @Pratik_Wavhal

if error message 51 retry remain same and values after that are changes then what we can do get all values starting like error message 51 retry
ex. error message 51 retry by 40 gm
error message 51 retry by 76 gm

@manoj2500

(from dr as datarow in dt where not dr.item(“message status”).tostring.contains(“error message 51 retry”) select dr).copytodatatable

1 Like

its giving me other error msg content

@manoj2500

(from dr as datarow in dt where dr.item(“message status”).tostring.contains(“error message 51 retry”) select dr).copytodatatable

Hi @manoj2500

StringVariable.StartsWith(“error message 51 retry”)

This can give you all the fields which will start with “error message 51 retry”

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer: