How to use only unique values and skip duplicate values of excel column in REFramework

Hello Community,

I have one excel file and that file work as input data in REFramework. I want to only use unique values and skip duplicate values of BO Id column and I have to send mail based on that row values to particular users.

Thanks & Regards,
Ronak Patel.

@ronak.patel

you can skip duplicates by using this in assign and then use datatable in your ref where you have only unique values which you can use to send email

dt = dt.AsEnumerable.GroupBy(function(x) x("Bo Id").ToString).Select(function(x) x.First).CopyToDataTable

cheers

Hi @ronak.patel

Use assign activity before reading the dt

You can try this in assign

uniqueData = inputData.AsEnumerable()
.GroupBy(row = > row.Field(“BO Id”))
.Select(group = > group.First())
.CopyToDataTable();

Hope this helps

@ronak.patel

As per error dt is empty…please check the filter you are using…may be it is filtering all the rows

cheers

@ronak.patel

after the generate datatabel activity check whether the dt has data or not

and also check any duplicate variables are present with the same name

use can check with this condition

DT.rows.count

later use this in assign activity

dt1.AsEnumerable.GroupBy(Function(a) a(2).ToString).Select(Function(grp) grp.First).copytodatatable

you can also try this by using column index

Hi @ronak.patel

you can use Remove Duplicate activity and provide the range and specify the columns you want to compare

image

@Gayathri_Mk

This is REFramework project. so, I can not use remove duplicates and I want to skip duplicate values not delete that values.

@ronak.patel

did you happen to check dt?

cheers

yes. I had check it but…
"dt = dt.AsEnumerable.GroupBy(function(x) x(“Bo Id”).ToString).Select(function(x) x.First).CopyToDataTable "
Not working.

@ronak.patel

Can you please tell what si not working…

and as per error previously shared looks like dt is empty please check the same

cheers

How to find unique values by in_TransactionItem (REFramework) and which condition can use in IF for check unique and duplicate for further process?

@ronak.patel

I hope your transactionitem is datarow

you can save the bo id into a separate variable adn check if bo id is already processed or not

in_Transactionitem(“Bo Id”).ToString will give the id and you can store it to string variable and concatenate all the values or store in list and append items to list…so if bo id exists already then you can ignore

cheers