Copy link to clipboard
Copied
I am attempting to create a reimbursement form, I have a field called Meal Row.0 that is a drop down. The options are Breakfast, Lunch, Dinner. The next field Allowance.0, I need the allowance to populate. So if Meal Row.0 is Breakfast, the allowance needs to be 10.00, Lunch is 15.00, and Dinner is 25.00. I have read over many different posts, but I get the SyntaxError: missing : before statement: at line 2. Below is a screenshot of what I have so far.
Eventually, I will be creating a calculation in a seperate field of the total reimburseable amount based on the allowance * the number of people that were paid for on the receipt. (If I buy your lunch then the allowable amount is $30 and if I spent 29, then I would be reimbursed 29. But If I spent 33.00 I would only get $30.)
Any help would be appreciated.
Copy link to clipboard
Copied
Give your options in dropdown export value to be amount you want and then in "Allowance.0" as custom calculation script use:
event.value = this.getField("Meal Row.0").value;
Copy link to clipboard
Copied
Thanks,
That gor rid of the Syntax errors, but when I tested it, the value did not populate.
Copy link to clipboard
Copied
If you apply export values that will be the value of the field when selected, not the display value, so you can just apply it directly in your code to event.value.
Copy link to clipboard
Copied
Ok thank you! I got that to work. I was able to do the next two calculations, but now I am to have it if payment method is Personal Account (export value 1) then Allowable amountrow1, otherwise 0. Allowable amountrow1 has a calculated value.
My intention here is that if the Payment method is Personal Account, I want the Allowable amount to be displayed. This is a calculation based on the amount spent vs the allowable amount.
In my test I enter 25 as the amount. then th erow1max1 calculate the max amount allowed based on the number of people * the allowance. the Allowable amount is if the amount is less than the max then the amount is displayed. if the max amount is lower the amount, then the max is diplayed.