Does UIPath have an Activity that allows for the random selection of line items in excel based off of a condition?

I am trying to build a bot that will randomly select a meal in an excel file based off of what protein the user indicates in the input dialog box. The proteins I have chosen are chicken, beef, and pork, with each category having three options for meals. I am wondering how I would go about implementing a random selector tool that would select a meal based off of the desired protein then open a corresponding pdf that is linked in the excel file for the selected meal. Here is what my excel file looks like. Any help would be greatly appreciated. Thanks.

Hello @William_Hinton_Rogers ,

Here in your excel the codes are repeating. For eg , chilli Con Carne and Rib-Eye Steak is having protein code as 2. So if you filter these excel with Protein code as “2”, it will give 3 rows of Data.

But I hope your requirement is only to Open the PDF of the corresponding Recipe Name.

Do the Steps below:

  1. Get the User Input using “Input Dialogue” activity and get the output to a string variable.(Get input as Recipe Name)
    2)Use Excel activity and Read the excel using Read Range activity. Filter the DataTable using the variable which you are getting in the step 1. You will get only one row of Data now.
  2. Then download the file.

Hello @William_Hinton_Rogers,

  1. Read the Excel file and save to a datatable.
  2. Get the user input and save that to a variable.
  3. Assign an integer variable Count with 3(As there are 3 meals, if there are more assign using that)
  4. Assign a Random number using this:
    new Random().Next(1, Count+1)
  5. Filter the Datatable using the Random Number like this:

Hope its clear.