Hello,
can anyone help me to create a workflow.
condition should be like this–>if this condition is true (Amount Spend >= Amount Allotted) then i need to extract that true data from excel sheet1 to sheet2 then need to send mail to one person with attached file.
Thanks in Advance…
Hi @ashwini_avula
welcome to forum
you can try this using linq query too
steps to be followed.
a. Read the excel and store in dt1 variable using read range.
b. build a datatable with required columns using build datatable activity and store in dt2
c . now use assign activity with below linq query
dt2 = (From row in dt1.AsEnumerable
Where CInt(row("Amount_Spend))>CInt(row(“Amount_Alloted”))
Let r1 = row.ItemArray
dt2.Rows.Add(r1)).CopyToDataTable
Try this way and let me know if it works
Regards,
Nived N
Happy Automation
Hello Nived,
I appreciate for your quick reply but I am getting error in assign activity. Can you check and update once.
Thanks…
Try below expression
varDT.AsEnumerable.Where(function(r) cdbl(r("Amount_Alloted").ToString)>=cdbl(r("Amount_Spend").ToString)).CopyToDataTable
what is that cdbl would you please explain that code
It is converting string to double
Hello Pravin,
Can you explain this expression varDT.AsEnumerable.Where(function(r) once.
Thanks in advance…
@Swetha_V AsEnumerable method gives you the rows collection and we are filtering it with conditions…It is the best way to avoid for each row.
In other ways, UiPath made a document also.
Refer to the below link for more information.
Add new System.Data.Datatable in both variables default value
Hi check with this query
Hello Pravin,
I am unable to filter the Allowed data to a different sheet. Can you help me with that?

Thanks in Advance…
@Swetha_V With filter data table activity are you getting any error or just an empty data table in return?
The select query for your solution would be like below.
Dt.Select("Status='Allowed'").CopyToDataTable