If function with double data type

Hi Guys,

I am trying to create a for each data loop with an embedded if function to conduct an action in case the value is smaller than x%.

For this purpose, I have the variable assigned (which is a string) and converted into a double data type (convert.todouble(variable) < 0.9) in the if function to identify the rows that require some sort of action.

However, I keep getting the same error message “If: Input string was not in a correct format.” and I dont know how to solve it.

Your help will be appreciated :slight_smile:

Cheers, Karim

Perhaps is below screenshot useful to understand the situation

Double-check your variable types and make sure that everything is as you expect. I was able to replicate what you have and get it working as expected.

If statement:



Hey Daniel,

Thanks! Appreciate your reply.

My setup looks comparable to your example, but there is still something I am overlooking here.

By the way, I didn’t use the activity ‘build data table’ but instead applies the ’ read range’ activity and filter the irrelevant columns. see below

Creating Data Table:

Loopting through DT:

Hi Daniel,

I think I found the mistake…

The range in the “read range” activity was incorrectly defined. I had from “A13: G100” instead of “A13 to G64” (to be specific). However, this brings me to another dilemma as the number of rows in the excel file I am using as an input file can differ from time to time…


If you know your data starts at A13 you can pass just that cell in to the Read Range activity’s Range parameter and it will read everything from that point on.

Thanks for your help Daniel :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.