Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments
Adobe Summit 2023 | Complete list of AEM Sessions & Labs
SOLVED

Adobe LiveCycle Calculation Help for a Specific Formula

Avatar

Level 1

Hoping to get some help on a calculation I need to input into LiveCycle:

 

Density Core Formula=(100-water-prot-fat-ash)/1.6+prot/1.4+ash/4.5+fat/0.93+water 

 

But unsure what to type into FormCalc to make this work ... 

@LiveCycle

1 Accepted Solution

Avatar

Correct answer by
Employee

It is actually pretty straight forward, using the calculate event I gave you the FormCalc and JavaScript variant. See here and you can open the PDF in Designer to get the script code

 

https://documentcloud.adobe.com/link/review?uri=urn:aaid:scds:US:a7fcaf0d-db8c-41db-ba31-bd3e14de1ad...

View solution in original post

3 Replies

Avatar

Correct answer by
Employee

It is actually pretty straight forward, using the calculate event I gave you the FormCalc and JavaScript variant. See here and you can open the PDF in Designer to get the script code

 

https://documentcloud.adobe.com/link/review?uri=urn:aaid:scds:US:a7fcaf0d-db8c-41db-ba31-bd3e14de1ad...

Avatar

Employee

mine defaults to 62.5 when all values are 0 - if you don't want that you can surround it with an if statement. I just showed how to bring your formula to FormCalc or JavaScript.

if (water.rawValue <> null or prot.rawValue <> null or fat.rawValue <> null or ash.rawValue <> null) then
  (100-water.rawValue-prot.rawValue-fat.rawValue-ash.rawValue)/1.6+prot.rawValue/1.4+ash.rawValue/4.5+fat.rawValue/0.93+water.rawValue
else
  0
endif