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

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Can someone help me please


Level 1

Hi all im trying to get a script that depending on the value of field name (code)  it

would ask me the percentage amount and then add that percentage amount to the total of another field 

basically what i'm trying to get is

if code = abc then ask to input amount of percentage then add amount of percentage to total

so if percentage =10 and total = 1000 then the amount of total would be 1100

any help would be greatly appreciated


3 Replies


Level 10

Hi there!

To quickly ask a question for a quick answer from the user, you can use the built-in function response.

It is the same thing as a messageBox but with a text field to insert a response / value

Hope this help!


Level 1


Thank you for your time i've inserted this code in my script and I do get it to

show the input percentage value in the percentage field with this code {Percentage.rawValue = rep}

but with this formula     sum (hours*rate+sub+$*Percentage/100)

my Total field ignores the +$*percentage/100 and only calculate the hours * rate + sub

I tried different formula but could get it to work


Level 10

don't use the sum function, it should be used only if you specify a multiple instance of an object like : sum(Row1[*].Percentage)

you are only calculating 1 row in this case.. so forget about the sum function

Not quite sure why it isn't working if removing the sum function doesn't work but try this instead (if you are using ($) as the keyword in FormCalc for (this) in JavaScript):

Hope this help!

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now