How to choose a random cell in an excel sheet

excel
forum

#1

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,

Andreas


#2

Hello,

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)

Regards,
Prakshi


#3

@Prakshi_Tyagi

Outputdatable.select("[dept] = ‘account’ ").CopyToDataTable()

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


#4

Awesome. Thanks. I will try :slight_smile:


#5

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


#6

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


#7

@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.


#8

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


#9

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


#10

@Vinay.Pandey Install Microsoft.Actvities.Extensions


#11

@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)
https:www.facebook.com

Help me to read the data from xlxs file.


#12

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

Best approach to read many fields from excel and paste /enter on webpage


#13