How to choose a random cell in an excel sheet

Hi there.

I am experimenting with excel and Uipath. I am sending several emails, but I want it to randomly select a new subject line in every email. How do I manage this?. I have 9 different subject lines, but I can’t get it to randomize/choose a new one very time :-/.

Best regards,



You can keep your 9 subjects in a dictionary with integers as keys and subject lines as values. And then use a random variable (new Random.Next(1,9)) to fetch the random subject value.

PFA the workflow for reference.randomSubject.xaml (8.1 KB)


@Prakshi_Tyagi"[dept] = ‘account’ ").CopyToDataTable()

In above statement how can i give array variable which contains different values in place of “account”.

Awesome. Thanks. I will try :slight_smile:

@Prakshi_Tyagi: Thanks for sharing workflow reference, but I am facing error while uploading your randomSubject.xaml file in my UIPath Studio.

@Vinay.Pandey may be that is due to version of uipath

@Manjuts90 : Thanks for fast response, can you please help me with this. As I want to read data from excel sheet. And data should be random.

@Vinay.Pandey Install all the packages(Local) than it will run

1 Like

@indra: I have installed all the packages, such as excel, csv … Please let me know which package I am missing to install.

@Vinay.Pandey Install Microsoft.Actvities.Extensions

@indra: Thanks it is running now. Appreciated Can you help me with a task. in which I have to read username and password from excel sheet and enter the same details for login.

LoginDetails - Copy.xlsx (6.5 KB)

Help me to read the data from xlxs file.

@Vinay.Pandey Follow below link and download googlesignup zip file

Best approach to read many fields from excel and paste /enter on webpage - #9 by indra

1 Like