How to extract values from a DataTable

I have a table with four columns. I need to search for a value in the first column and return the value found in the fourth column. I have already extracted the table into a DataTable, but I am unable to perform the correct assignment.
any method are welcome.

I have endeavored in this pursuit, yet success continues to elude me.

HI,

In the image of immediate panel, it seems problem about = operator. For now, can you try to use Equals method instead of = operator?

Regards,

1 Like

In the end, I approached it from a different angle. I used the Look up activity, and it worked perfectly. The last hurdle I face is that I need to be able to extract the datatable even when the Excel sheet is open. Is this possible?

The image shows a workflow process involving reading a workbook sheet named "hoja1" and looking up data in a table where the column name is "Cuit Representante". (Captioned by AI)

Hey @Matias_Clemente.Arg,

If the excel is open, I am assuming by a different user:

1- Read range workbook, if it fails because user X has the workbook open (TryCatch), copy the file to a local drive, read the copy (offline), and then delete it. (Bear in mind that the copy will not have the unsaved changes by the user)

2—If it’s the bot itself that has the file open, Excel Activities (not workbook) should be able to read it even if it’s open.

1 Like

HI,

Basically, we can use ReadRangeX activity with UseExcelFile as the following when excel application is running and it opens the file.

If you need to use ReadRangeWorkbook for some reason, workbook property of ReadRangeWorkbook with classic ExcelApplicationScope may help you. In this way, ReadRangeWorkbook doesn’t throw exception even if the file is open.

Sample
Sample20240919-1.zip (9.3 KB)

Regards,

1 Like

Thank you both, @Yoichi and @ignasi.peiris. Both of your responses were helpful. The idea was for the same user to have the file open, as it is a file that is often used for different purposes, but remains fairly static. Nonetheless, you both provided the answer I needed. Thanks again.

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