Add a function to get the current field's value within the Form Calculation Arcade profile

1921
2
07-14-2023 02:21 PM
Status: Open
Labels (1)
Gavin_Leavitt
New Contributor II

I would like to be able to get the current value from a form input without having to call the field by name when doing a calculation within Field Maps Form Calculation profile. 

Take the following example that is calculating on the form input "DateTimeCompleted":

var current_datetime = Now()
var f_name = "DateTimeCompleted"
var exist = $feature[f_name]
if (!IsEmpty(exist)){
  return exist
}
return current_datetime

Instead of calling "DateTimeCompleted" it would be useful to use a contextual function to get the existing value of from the field that is getting calculated.

This would make it easier to write generic Arcade functions that can be quickly re-used. 

2 Comments
JustinReynolds

Hey Gavin,

 

To clarify, within the Form Calculation and Form Constraint Profiles, are you seeking a profile variable similar to something like $self and by extension $originalSelf?

Gavin_Leavitt

@JustinReynolds Yes, I was not clear on the correct terminology for this idea, but profile variables of "$self" and "originalSelf" are exactly what I am asking for.