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: