• Resolved mwokasch

    (@mwokasch)


    Two other pretty significant discrepancy from the previous version. First, I can’t seem to be able to get the values out of a Repeater field. Second, I used to be able to use javascript to do computations. Neither seems possible now.

    This is how I used to calculate the ages of people field_rnField57 was a repeater field and “childBD” was a field within that repeater field. This would set the age of the child based on the date the form was submitted:

    var bd1 = new Date($$field_rnField57$$.GetField(current,'childBD'));
    var today = new Date();
    
    return today.getFullYear() - bd1.getFullYear();
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author EDGARROJAS

    (@edgarrojas)

    You don’t need t use getfield now you can access the fields directly and the formula will know you are talking about the current repeater item. For example, this formula:

    [RNF “15” RNF].GetDate().getFullYear()

    Will get the full year of the datepicker field with id 15 (assuming you have that field within the repeater).

    It is not possible to call new Date() though, unlike smart forms this plugin doesn’t use javascript directly to calculate the formulas so calling a native function like new Date() is not possible. I will add a way to access the current date in the next release.

    Regards!

    Thread Starter mwokasch

    (@mwokasch)

    This works. For anyone trying this later, you either need to type the code elsewhere and copy it into the formula box or type it this way: RNF “15” RNF and then add the ] followed by the [.

    If you don’t the editor seems to eat the reference to [RNF… RNF] before you get actually edit it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Repeater values used in Formulas / Date formulas’ is closed to new replies.