Hello. I've been running into a consistent issue where photos are not always attaching to my points correctly, despite the device stating that it submitted. In response, I've been attempting to create a control method that is usable on the field, in real time, offline. The code I have so far is as follows:
var AtchNum = Count(Attachments($feature))
if ($editcontext.editType) {return AtchNum}
else {return '0'}
The issue I'm encountering is that the calculation only occurs at point creation, not point submission. This is important because it returns 0 every time because the moment the point is created, there is no data therefore the return is 0. But I need it to return a nonzero answer. My var creates this number, and the purpose of the editcontext feature is supposed to be to force the code to recalculate when the point data is updated, such as when a photo is added. This feature doesn't appear to be working however, and I can find no explanation on how to properly use this variable.