Extracting specific data from excel

I want to extract bank account number and GSTIN No from excel from excel in Uipath Can anyone please help me in extracting this data from given excel? Below is the screenshot of excel provided.

Hi

If the position is always same that is cell position for GSTIN no and account remains same then we can use READ CELL activity where mention the cell position as “B21” for GSTIN and “B18” for account number and get the output as string values

Or

If the position doesn’t remain same and if it keeps changing then use the below step to get the values

  1. Use a excel application scope and pass the file path as input and get the output as dt with read range activity

  2. Then use a FOR EACH ROW activity and pass dt as input

  3. Inside the loop use a IF condition like this
    CurrentRow(0).ToString.Contains(”GSTIN”)

If true it goes to THEN block where use a assign activity like this

str_GSTIN = CurrentRow(1).ToString

Similarly we can do the same for bank account number with another IF condition inside the loop

Hope this would help you resolve this

Cheers @Seema_Jethe

Hi,

Can you try like the following?

dict = dt.AsEnumerable.ToDictionary(Function(r) r(0).ToString(),Function(r) r(1).ToString())

Sequence2.xaml (5.5 KB)

Regards,

1 Like

@Palaniyappan No the cell position may change

@Yoichi Is is applicable even if the position of Bank Account number and GSTIN No changes in excel?

Hi,

Yes, if they are in ColumnA and there is no duplicated text. Can you try this in actual?

Regards,

Then in that case these steps would help you

@Seema_Jethe

1 Like

@Palaniyappan thanks your solution helps

1 Like

@Palaniyappan I need an if condition to compare variables. But my if condition has some error Can u please help me with this issue?
Below is the screenshot
image

l

Hi,

Use AND instead of && and try. thanks.

@kirankumar.mahanthi1 thanks

1 Like

As you are using vb net kind of project we can use AND , OR operators

Glad it got resolved @Seema_Jethe

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