Splitting a datatable based on 2 column percentages


#1

I’m guessing my logic is completely wrong on this one, but what I’m trying to do is :

  1. I have a data table of 2 columns of percentage values ( puppy food is eaten / puppyhood ) and puppy name

https://i.imgur.com/53eE0mi.png

and what I want to do is work through the pet name, the percentage group of food & the time there to display different messages based on those conditions.

For example, an end result could be :

“Mika has only eaten 9% of her food and is 65% of the way through her puppyhood! Please contact a vet immediately!”

"Muffin has eaten 170% of her food but it only 43% of the way through puppyhood. Stop overfeeding!

==========

I thought I could do this with multiple switches, with the thought process of “if the puppy is 0>25 through puppyhood” then check if food is
0-25 / -25-50 / 50-75 / 75+ and assign a message box to each different bracket displaying the results.

However, everything I try seems to throw curveballs back at me.

Am I on the right thought process here? I’m new to uipath and coding so just wrapping my head around things is sometimes a bit difficult.

And if I am, what would be the best way to handle it?

Thank you so much for taking the time to read my post.


#2

@Zak_Cooper based on food eaten u have to display message na


#3

I don’t understand sorry


#4

@Zak_Cooper

i didn’t get what it means exactly


#5

Does this make more sense? Sorry i had a hard time trying to describe it but maybe this flow will do a better job.


#6

@Zak_Cooper i am unable to see image which you have posted


#7

direct link to image does this work for you?


#8

So I managed to work it out.

For anyone else wondering,
Use a for each row activity, and then a get row activity.

Set get row to export the column you want.

Assign the generic export variable to a string

Assign the string to a int32.

Then continue using the switch activity to filter via percentage.

There is probably an easier way, but this is the way that worked for me.