Getting a details of specific value

i have input value SE01207, i am scraping a data table say as below

|check1|SE01205|Terminated|
|check2|SE01206|Activated|
|check3|SE01207|Terminated|
|check4|SE01208|Activated|
|check5|SE01209|Terminated|
|check6|SE01210|Activated|

i want to extract the data of the Input value SE01207 ---- check3 and terminated into variables…

will LINQ help me in this… if so can anyone give the linq for the same.

@devasaiprasad_K,

Select Query would be enough for this.

dtInput.Select("[CheckColumn]="+strInput).CopyToDataTable

Sample Code:

LINQDEMO1.xaml (8.0 KB)

Just replace dtInput with your datatable variable and I wasn’t sure about the column names but given sample names. Change as per your names.

Thanks,
Ashok :slight_smile:

Hi @devasaiprasad_K

You can use the LINQ Expressions to store the required output in two variables called Value1 and Value2.

→ Use Read range workbook activity to read the excel and store in a datatable variable called DT.
→ Use the two assign activity to write the LINQ Expression,

- Assign -> Value1=(From X In DT.AsEnumerable
                    Where X(1).ToString().Equals(inputValue.ToString())
                    Select X(0)).FirstOrDefault().toString

- Assign -> Value2=(From X In DT.AsEnumerable
                    Where X(1).ToString().Equals(inputValue.ToString())
                    Select X(2)).FirstOrDefault().toString

Check the below workflow for better understanding,
Sequence19.xaml (13.5 KB)

Check the below required output in output panel-
image

Regards,

Use Generate Data Table to make it a proper datatable. Then you can easily use other activities like Filter Data Table, Lookup Data Table, etc to get what you want out of it.