How can i get a value from a csv file

I’m trying to filter a csv file ro return to me the value that i want, but every search only returns to me Null values.

I’m using read csv to put it into a datatable, then i use Lookup datatable to filter it.

this is the csv file
image

thease are the properties from lookup datatable
image

I’m using “Valor_total” as a filter to return “Item”

Hi,

Why don’t you use FilterDataTable activity?

https://docs.uipath.com/activities/docs/filter-data-table

Regards,

I’ve tried it too, but the result is the same.

Look, i’m using write line activity, the result is Null

Hi,

Can you share your filter condition and expected output?

Regards,

Filter condition

Filter datatable
image

Lookup datatable
image

When
qtditem = 2
valorTotal = 656,04

The output has to be RX00ZH1600

@guilherme.dias

Try placing a output datatable activity and check the output how you are getting

Also in Read CSV have you enable Add Headers in the properties?

image

Hope this may help you

Thanks

1 Like

Hi,

For now, can you try the following sample?

Sample20220411-3.zip (2.8 KB)

Then, can you check if there is difference between the above and yours?

Regards,

When i try to use my file it does not execute the message box. if i put the message box out of the If condition it returns me the error: there are no rows in position 0

Hi,

If possible, can you share your csv file (and xaml file)?

Regards,

I’ll organize it and send to you. But there is somethig wrong with the values in my csv file, if i copy the values from your file then paste it in mine it works.

The problems is, this csv file is generated from my comapany’s system, so i can not change the properties.

GarantiaComICMS.zip (660.3 KB)

These are the files

Hi,

I just modified it to have use FilterDataTable and it seems to work well. Can you try the following sample?

GarantiaComICMSv2.zip (4.6 KB)

Regards.

Its working! Thank you!

Can you explain to me how “dtEnt_GaranFiltered.Rows(0).Item(“Item”).ToString” works?

Hi,

This means get data in a column named Item and 1st row of dtEnt_GaranFiltered.
If there is possibility multiple target data exists and want to get all the data, it might be better to use ForEachRow activity.

Regards,

Thank you, for this robot it is better if it catch just the first row.

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