Returning 0

Viewing 6 reply threads
  • Author
    Posts
  • April 30, 2019 at 7:15 PM #34600

    Tim Flick
    Participant

    I have two field one is a number field, steps, and the other is a calculated field step miles with the return set to be a number. Why if I have a value in the step field of 10,000 and the step miles is set at step/2000 does it return 0 instead of 5

    Tim Flick

    April 30, 2019 at 7:18 PM #34601

    Brendan
    Keymaster

    Hi Tim,

    It should return 5 for 10000/2000.

    Can you send me your form template so I can take a look at it?

    Thanks,

    Brendan

    April 30, 2019 at 7:28 PM #34602

    Brendan
    Keymaster

    So the reason it’s behaving this way is because you have a Section heading (Steps) with the same name as your number field (Steps). Tap Forms was dividing the section header by 2000.

    Just rename the section heading or steps field to something unique and re-enter your formula. That’ll fix it.

    April 30, 2019 at 7:58 PM #34603

    Tim Flick
    Participant

    Interesting when I deleted section heading it removed steps from formula Thanks

    April 30, 2019 at 8:55 PM #34604

    Brendan
    Keymaster

    Yes, because your formula was referencing the Steps section heading field. You didn’t have to delete the Section Heading field. You could have just renamed it and then re-saved your formula.

    May 1, 2019 at 2:59 PM #34610

    Tim Flick
    Participant

    Actually in the formula editor on the field drop down list I selected steps which showed it was a numeric field

    May 2, 2019 at 1:56 PM #34619

    Brendan
    Keymaster

    Right. But in the iOS version, Tap Forms selects and displays the name of the field in the formula. Behind the scenes when you save the formula it uses the name of the field to lookup the internal ID of the field before it saves the formula. So having two fields tie the same name caused Tap Forms to pick the first one it came across with the Steps name, which in this case was the wrong one. I should probably add some code to tell it to ignore Section Heading fields of course.

Viewing 6 reply threads

You must be logged in to reply to this topic.