How can I copy name, email, and phone number from excel into outlook contact WITHOUT ForEach?

Hey,
There is an answer in the following link:
https://forum.uipath.com/t/how-can-i-copy-name-email-and-phone-number-from-excel-into-outlook-contact

BUT, I can’t use ForEach. (This is the requirement)

Someone can help?
@gustavo.cervelin maybe you? :slight_smile:

1 Like

Hi @Lior_Shamir ,

strName = Convert.ToString(dt.Rows(0)("Name"))
strMail = Convert.ToString(dt.Rows(0)("Mail"))
strPhone = Convert.ToString(dt.Rows(0)("Phone")

Regards,
Arivu

Hi @arivu96,
I need to run through the excel doc without knowing the length of rows

1 Like

Hello @Lior_Shamir

Welcome to UiPath community…!

You can use Filter Datatable activity and filter the table based on condition(maybe name).
Then use the index or column name to get the required data.

Thanks

Hi, @Rahul_Unnikrishnan

The only activities I can use are:

Use Application/Browser, Click, Keyboard Shortcuts, Type Into, Get From Clipboard, If, Assign, Terminate Workflow.

1 Like

Any challenges in using the Excel packages? Because using UI based automation for excel is not recommended.

Thanks

@Rahul_Unnikrishnan

It’s for an interview - they restricted me to use the above activities only.

1 Like

Hi @Lior_Shamir,

Can you use a flowchart to iterate/process all DataTable rows?

Then, you would have a variable to store the number of rows (an assign activity is enough) and another variable which would work as a counter (an assign activity is enough too).

Finally, you could have a flow decision to check if there are more rows to be processed.

This way you would have a loop without using a for each / for each row / while / do while activity.

But, I am not sure if you can use it.

Let me know :slight_smile:

1 Like

Hi @gustavo.cervelin!

Yes, I need to use Flowchart.

Can you show me example of your suggestion?

1 Like

Hi @Lior_Shamir,

Find below an example

Main.xaml (16.4 KB)

If this solves your problem and you agree, kindly mark the post that helped you the most as solution to close this topic.

If you need extra help and/or have any questions, please let me know :slight_smile:

Thanks!

1 Like

Why is the requirement NOT to do it the right way?

Hi @gustavo.cervelin,
thanks a lot for the help, but in your example you use Read Range - they don’t allow it.
You have an alternative?

1 Like

@postwick
GOOD QUESTION!
I guess they are looking for creativity… or to exhaust the person

1 Like

@Lior_Shamir,

Where is the data coming from?

@gustavo.cervelin Excel file

1 Like

@Lior_Shamir

I think I have an alternative.

I let you know asap

1 Like

Hi @Lior_Shamir

Instead of read range try opening excel and you can do a ctrl+A and ctrl+c to copy whole data. Then if generate datable is allowed then use it to get dt… if not then use regex to get the values and then use them

Cheers

Hi @Lior_Shamir

Please, take a look at the example below. Although in my opinion this exercise does not make sense due to this limitation of the activities that can be used, the example below uses only the allowed activities.

Main.xaml (53.0 KB)

As I don’t have Excel installed and don’t plan to install it now, I used Google Sheets. So I ask you to try to understand the idea of this solution and adapt it to work with Excel.

Basically, you will have to change the first activity (Use Application/Browser) to open your excel file and the selector of the click activity.

If you don’t understand it, let me know.

By the way, that’s the table that I used as example:

If this solves your problem and you agree, kindly mark the post that helped you the most as solution to close this topic.

If you need extra help and/or have any questions, please let me know :slight_smile:

Thanks!

1 Like

Hi @gustavo.cervelin :slight_smile:
Looking good. I will try it later and will update you.

thank you!!

1 Like

Hi @gustavo.cervelin,
Thank you! Its working!!!
Now I need to do the same thing, but when the excel file is close - so I can’t use Keyboard Shortcuts Activity.
For opening excel file I’m using Excel Application Scope Activity.

Do you have an idea for me?

1 Like