1

I am using the Podio variables and it's returning unexpected results.

var $arr_type = @All of TIME TYPE;
var $arr_duree = @All of DURATION;
var $result = 0;
for (var i = 0; i < $arr_type.length; i++) {
    if($arr_type[i] == 'WANTED_TYPE')
        $result += $arr_duree[i];
}
$result;

TIME TYPE is a category field. DURATION is a duration field.

How can I return the string of the category? $arr_type[0] returns 0 and $arr_type[1]doesn't process.

See screenshot: http://dev.magikweb.ca/hotlink/screeny.png

Thank you for any feedback!

Solution

This is actually a working exemple. I was comparing ouvrable when it should of been Ouvrable. The calculation field is VERY limited about debugging.

Vincent Poirier
  • 4,298
  • 5
  • 21
  • 25

1 Answers1

1

JavaScript is case sensitive. Look at the value of WANTED_TYPE and see if there's some caps in it.

Example: if you have a value called "Potato" and you compare to "potato", the result will be false.

Mathieu Smith
  • 378
  • 1
  • 13