Select to view content in your preferred language

Recalculate in Edit mode

1749
8
10-06-2022 12:04 PM
Hammers211
Regular Contributor
I am using an embedded survey in which there is a large number of calculate fields, and I would like all of those fields to recalculate without having to click the "Recalculate" button manually. I have tried using the URL parameter, however I don't think I'm doing it correctly. Is there a specific manner in which I need to input the parameter? Do I need to specifically reference each calculate that I would like to automatically recalculate?
8 Replies
DougBrowning
MVP Esteemed Contributor

I would say the new Calculation modes but it looks like these are not supported in the web yet.

https://doc.arcgis.com/en/survey123/desktop/create-surveys/prepopulateanswers.htm#ESRI_SECTION2_5938...

Are you talking about this URL param?

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-web-form-url/ba-p/... 

Recalculate values when in edit mode (forceRecalculate)

Use the forceRecalculate URL parameter to force certain fields to be recalculated, even if the record is opened in edit mode. This can be very handy, for example, if you want to record the name of the person editing the record, or to refresh the date when the record was last edited.

...?forceRecalculate=question1,question2

If so post the URL you are trying so we can try and fix it.

 

You can also use an if(the field they change, value, value) to trick it to fire.  I have even seen a did you change something question that you then use in the if to get it to recalc.

 

 

 

0 Kudos
Hammers211
Regular Contributor
0 Kudos
DougBrowning
MVP Esteemed Contributor

I think just add to the end  &forceRecalculate=question1,question2 and list which fields to recalc.

0 Kudos
Hammers211
Regular Contributor

I tried it like this:

https://survey123.arcgis.com/share/9cf4c3f33ac44231a36030dde78afb9b?mode=edit&globalId={globalid}?fo...

For the below field:

Hammers21_0-1665157463058.png

Still not working though. 

0 Kudos
DougBrowning
MVP Esteemed Contributor

I think it is & and not ? before Force   ? is just once then & to add more I think

0 Kudos
Hammers211
Regular Contributor

OK, got it working, there is still an issue though. When setting edit mode to globalid:

?mode=edit&globalId={globalid}

any other functions appear to break.

Any suggestions?

0 Kudos
DougBrowning
MVP Esteemed Contributor

Check the case carefully.  You have one upper case I and one lower case i. globalId={globalid}  Check the service and match it exactly.

0 Kudos
mwartman_grey
Occasional Contributor

Updated January 9, 2023. The url parameter ?forceRecalculate is now ?recalculate