transform adobe javascript to aem formcalc | Community
Skip to main content
New Participant
Mar 2, 2023 11:39 AM UTC
Solved

transform adobe javascript to aem formcalc

hello

I have this script 

// Get field values as numbers

    var v1 = +getField("Text2 ").value;

    var v2 = +getField("Text10").value;

    var v3 = +getField("Text12").value;    

      var v4 = +getField("Text11").value;   

// calculate this field value

    event.value = v1+v2+v3 - v4;

how can i transform it to aem FormCalc;

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Mayank_Gandhi
Mayank_GandhiAccepted solution
Employee
Mar 2, 2023 11:49 AM UTC

@klothoskir1 

the value will be in rawValue can be get using fieldname.rawValue

myField1.rawValue + myField2.rawValue + myField3.rawValue

var is supported so you can put it in var

2 replies

Vijay_Katoch
New Participant
Mar 2, 2023 11:52 AM UTC

Refer to this for Formcalc syntax and built-in functions

https://helpx.adobe.com/pdf/aem-forms/6-3/formcalc-reference.pdf

 

Translate
Mayank_Gandhi
Mayank_GandhiAccepted solution
Employee
Mar 2, 2023 11:49 AM UTC

@klothoskir1 

the value will be in rawValue can be get using fieldname.rawValue

myField1.rawValue + myField2.rawValue + myField3.rawValue

var is supported so you can put it in var

Translate