arcade calculation - once() or only when null

391
2
Jump to solution
09-23-2022 03:05 PM
PaulPetersen1
Occasional Contributor

I've been using Arcade calcuation expressions with good success in Field Maps. However, I'd like to know if it's possible to trigger the calculation only when the associated field is null. This would be similar to the once() operator, of the Survey123 whenEmpty calculation mode. Basically I want to make sure the calculation (the inspection date) doesn't get overwritten if the Smartform is opened at a later time after initial collection.

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

The IsEmpty function returns "true" if the value is null or empty ('').

If (!IsEmpty($feature.InspectionDate)){
  //save a new Inspection Date
}

View solution in original post

2 Replies
KenBuja
MVP Esteemed Contributor

The IsEmpty function returns "true" if the value is null or empty ('').

If (!IsEmpty($feature.InspectionDate)){
  //save a new Inspection Date
}
PaulPetersen1
Occasional Contributor

Thanks, that helps.

0 Kudos