If activity on integer

datatable
excel
uiautomation
activities
uipath

#1

Hi all,

I need help with an if activity. Firstly, I have a column of data that I want to use the if activity on.
I want to put the condition so that if the number found in each row of the column of data is below 9.10, a new column will write a certain word.

Thanks!


#2

You can write an assign statement to check and assign the value.
image
To: dtInputData.Rows(intIndex).Item(“New_Column”)
Value: if((Convert.ToDecimal(dtInputData.Rows(intIndex).Item(“Number_Column”).ToString) > 9.10), “Update text”, dtInputData.Rows(intIndex).Item(“New_Column”).ToString)

This checks whether number column value is greater than 9.10. If yes, updates the New column with the given text, otherwise, reassigns the New column value (To retain the same value if there any. Based on your requirement you can leave this blank as well).
intIndex is the index of your row.


#3

Hi @Madhavi ,
is there any sample that I can see?

Thanks!


#4

Sample.xaml (8.6 KB)

Untitled spreadsheet.xlsx (3.6 KB)
Refer this @jasperlzx


#5

I need to pass column H as either Late/Not Late based on the value of the Time In. If its above 9.10, it would be late.

Thanks!


#6

Refer this Sample.xaml (8.8 KB) and let me know if it works @jasperlzx


#7

Hi, I did what you wrote in the sample file, and I receive this error message :If : Column ‘Time In’ does not belong to table。

Any idea on how can I solve it?

Thanks!


#8

@jasperlzx Here you go…
ColumnComparisionAndUpdating.xaml (12.0 KB)


#9

Untitled spreadsheet (2).xlsx (6.8 KB)Sample.xaml (9.5 KB)
@jasperlzx


#10

image

Got this error now…


#11

The column does not contain any values,Can you share your workflow and excel file(or) Try to make change in this file and executeSample.xaml (9.0 KB) @jasperlzx


#12

Now I get this error, but I do have this column as shown above


#13

Give space “Time In”.There is space inbetween in your excel file @jasperlzx


#14

I removed the space for both files and it won’t work as well


#15

Did u provide the columnname in ’ '?Change it to " " (Or) send me the excel file I’ll make changes and upload the solution @jasperlzx


#16

Template for Individual Attendance Report.xlsx (9.6 KB)

Thanks!


#17

@jasperlzx,Sample.xaml (9.7 KB)
Modified it with your excel file,Your excel file contains headers in the second row so it was unable to find the ‘TimeIn’.Let me know if it works


#18

Hi,

For the get row item, how do you get the term “row” ? is it a variable or?

Thanks!


#19

@jasperlzx Did you try the xaml I sent? I have handled the blank row case as well.


#20

sample

Row is each row item from the datatable.It is user defined @jasperlzx