Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Need an In-Field Calculator Function Similar to Excel's "=" Sum Function For Data Entry

Avatar

Level 3

I created a new expense form with a bunch of numeric fields for things such as transportation, lodging, meals, etc.  This form replaced an Excel spreadsheet.  Everything works fine, but now users miss the Excel sum (=) function to manually calculate a total for a field themselves.

For example, a user has four different charges for transportation that he needs to total up, and then needs to enter that total in the transportation numeric field of the form.  In the Excel version, the users had the ability to do an on-the-fly calculation, or sum, right in a cell, instead of using a calculator.  The user would click on the transportation cell, type the "=" sign, followed by the values to add, and press Enter.  Example:  =20+10+15+25   (and Press Enter)    This would enter the value of 70 in the Transportation cell.  It makes it simpler and quicker than having to open Calc, enter the numbers, and transfer the total.


Here's a quick video demonstrating the method in Excel:  https://www.dropbox.com/s/05d0umq89ky46do/Sum%20in%20a%20Field.mp4?dl=0

It would be really helpful if there was some sort of JavaScript to allow the same functionality in LiveCycle forms.  Has anyone attempted to accomplish this before to allow for in-field calculations by the user?  If this is possible, how would I go about doing it?

Thanks!

4 Replies

Avatar

Level 3

No replies yet.  Must be someone out there that has come across this need.

Anyone??

Avatar

Level 3

This image better explains what I would like to do....

Expenses2.jpg

Avatar

Level 7

On the calculate event for the field you could do something like

eval(this.rawValue)

don't include the equal sign though.

Avatar

Level 3

It seems that will only work with text fields.  I have 98 numeric fields that I would need to change, and then I'm summing all of the expenses for each day at the bottom of each column.  Each column total is derived with this formula:  sum (Table_Exp.Row1[*].Amount1).   If I change all of the numeric fields to text fields, I would then need to find out how to convert the values back to numeric to allow for the formulas to work.