Select to view content in your preferred language

Can I stop a note form a recalculation when opening from Sent or Draft?

560
4
07-01-2019 09:36 AM
DougBrowning
MVP Esteemed Contributor

I have a simple time on my form that tells the user how long they have been going while adding repeats. 

Calc is if(${SpeciesList},round(int(now() - ${StartedForm}) div (1000*60),1),round(int(now() - ${StartedForm}) div (1000*60),1))  

If I remember right I do the If so that it recalcs on each repeat add.

The issue is it also recalcs as soon as someone opens the form back up from sent.  This causes the time to go really high.

Is there a way I can get it to calc each repeat but not when reopening from Sent or Draft?  If they add more data I get it but even just looking at the old one changes the value.  

Maybe my if is if(opened from sent or drafts?, keep old val, else calc new val).

thanks for any ideas.

0 Kudos
4 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Doug,

I'm not seeing the behavior you are describing - can you compare your form to the one attached?

0 Kudos
DougBrowning
MVP Esteemed Contributor

Our formulas are the same but we tested again and it does recalc the minutes

Are you opening from Draft or Outbox or Sent? Seems to do it in each.

In some ways it makes sense because the calc uses now() - which is always changing.  I think i tried End also but same issue.  Not sure though.

Thanks

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Doug,

I was testing opening from the Sent Box for editing.  The values did not change when opened.

I would expect the recalculation to not occur as the new value would be different from the original value; Survey123 is supposed to preserve the original value in that case.  

0 Kudos
DougBrowning
MVP Esteemed Contributor

Using your example if I add the same time question outside the repeat, and change it to a Note field - then it will recalc when coming back from Drafts.  It will even change just navigating the repeats using the arrows. 

As Text it will show the recalc button but not recalc. It is looking like Text as read only may work differently than note? 

Do all Note fields update when just viewing from Drafts/Sent?  Never noticed before but that is what seems to be happening.

Attached. 

Thanks

0 Kudos