Select to view content in your preferred language

Survey123 calculationMode=whenEmpty stopped working

353
2
08-16-2023 02:45 PM
JerrySneary
New Contributor III

Hi @IsmaelChivite or anyone else, 

The parameter calculationMode=whenEmpty has stopped working for me. It's been working for almost a year. After a process of elimination, I found that if I turn off "readonly" or "hidden" it works, but if I turn off "readonly" or "hidden" it gives the submitter the ability to recalculate the field which I do not want to happen. Why is this happening, is this a new bug or expected behavior after one of the updates? Is there a work around to fix this?

Kind regards,

Jerry

Tags (1)
2 Replies
JonCardiello
New Contributor II

Hey Jerry,

I've been running into this same issue. Any luck?

Thanks,
Jon

0 Kudos
JerrySneary
New Contributor III

Hi @JonCardiello ,

For me it first happened on a date field. I figured out that if I wrap my calculation in "once()" that it behaves the same as "calculationMode=whenEmpty". If you want it to be read only create a note field to display your calculation. Make sure you set the "body::esri:visible" field to "no" to hide your original field with the calculation. Below is an example from one of my projects. I now use this method for any field that I want to use "calculationMode=whenEmpty".

typenamelabelhintguidance_hintappearancerequiredrequired_messagereadonlydefaultcalculationconstraintconstraint_messagerelevantchoice_filterrepeat_countmedia::audiomedia::imagebind::typebind::esri:fieldTypebind::esri:fieldLengthbind::esri:fieldAliasbody::esri:stylebind::esri:parametersparametersbody::acceptbody::esri:visible
dateDate_of_RequestDate of Request:       once(today())        esriFieldTypeDate   calculationMode=whenEmpty  no
note <b>Date of Request:</b>       format-date(${Date_of_Request},'%m/%d/%Y')               regex(${Location_Status}, "P01|B1|T5")

 

Kind regards,

Jerry

0 Kudos