Hello.
I have a form that is edited by multiple users at various dates. There are 3 groups and each group has a date field that needs to be populated.
I'd like the dates to be autopopulated, and I've used date() function for all three fields, however, if the form is opened again at another date, all the date fields from previous entries are changed the current date.
I need to retain the original dates - is there are way to do this?
Many thanks,
Lindsay
Hi Lindsay,
Good afternoon. You can use an Arcade expression on that field. I've included a sample below. You will need to update the name of your date field. This will capture the date when a new feature is added, but it will remain read only after that.
if ($editcontext.editType == "INSERT") {
var originalDate = Today();
//keep original date
return originalDate;
} else {
return $originalFeature.yourdatefield;
}
Worked like a charm! Many thanks!
Hey Kerry - after adding some new data - with no dates recorded as of yet - i see that there is an issue with the code capturing that first date submission.
If the field is null to begin with I need the user to submit that, then after retain that specific value throughout the lifecycle of the inspection.
I've tried to add a date() at the beginning of this expression with no luck - thoughts?
SO i figured this out - on features that are already exisiting, where the user is no actually creating new geometry - UPDATE is used instead of INSERT.
Thanks for getting me started on that one 🙂