Hello -
I have a hosted feature layer in ArcGIS online, and I am creating a form in the new Map Viewer that will be pulled into Experience Builder for editing data. I would like to calculate a field, based upon values entered in two previous fields.
TEST_TOT_SCORE_DOUBLE = TEST_SCORE_SHORT + TEST_PAR_DOUBLE
But I cannot get the calculated field to calculate. I am not sure if I have my Arcade expression wrong (I am very new to Arcade) or if its related to one field being short and one being double, and the calculated field double, or something else. Below is my Arcade expression.
Many thanks in advance,
Leila
Solved! Go to Solution.
If there is no error in the arcade editor and the value equals what it should (look at objectiD 1 in your table), the arcade is correct then... I don't think you have to worry about that. When you build the form, does it show that the field is based on a calculation?
Below is an example adding short (integer) + double = double. and double +double = integer. Hit Tab to calc. Arcade doesn't seem to care much that it's calculated with multi types.
I think you need a return statement. I'm new to this also. I believe the semicolons are also needed. Here's code I'm testing that seems to work:
The nature of Arcade allows you to do the simple equations without setting variables. 1+1 will return 2; 1+A will return 1A
Ex. Long+Double = number
My question is, what does return when you click "Run" in the Arcade editor? Does it say "null" or "error"? That would help identify what is going on.
Hi Teresa -
Thanks for your reply. When I hit run it appears to run without error and returns a value - see snapshots below. But when I got to edit, it does not update the Total Score when I update either of the 2 fields, or both.
Best,
Leila
If there is no error in the arcade editor and the value equals what it should (look at objectiD 1 in your table), the arcade is correct then... I don't think you have to worry about that. When you build the form, does it show that the field is based on a calculation?
Below is an example adding short (integer) + double = double. and double +double = integer. Hit Tab to calc. Arcade doesn't seem to care much that it's calculated with multi types.
Thanks Teresa -
I did not have the expression checked so it did not show up as a calculated field. Not very intuitive. Thanks for pointing that out. It is working now.
Best,
Leila