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
BedrockMission!

Learn more

View all

Sign in to view all badges

Can someone help me please

Yvan_Leduc
Level 1
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


Thanks 

3 Replies
Magus069
Level 10
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!

Yvan_Leduc
Level 1
Level 1

Greenshot.jpg

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



Magus069
Level 10
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!