I've made a custom Survey123 form using the Web App JavaScript API, which works great. However, I need to submit the form request while passing field names to the recalculate parameter, and I don't see this property in the documentation for the Survey123WebFormOptions class.
I can set mode, portalURL, version, etc. through the API, but not recalculate. Does anyone know if this is possible without modifying and self-hosting the API code?
Solved! Go to Solution.
For now, we're just going to modify the API code and self-host. In case anyone needs to have access to this parameter (or any other web form URL parameter not available in the Survey123WebFormOptions class), you can add:
const qqq = this.recalculate;
qqq && (t.recalculate = qqq);
to the getUrlQueryString() function of the Web Form API, then add a recalculate parameter to the web form instance in index.html, like so:
const webform = new Survey123WebForm({
clientId: 'uWqBqfybE4SWiQJL',
container: 'formDiv',
portalUrl: 'https://gis.example.com/portal',
mode: 'edit',
globalId: globalid,
itemId: '5780e99999904bb9b981b7a99999999',
recalculate: 'field:Reinspect_Status,field:Scenario_Types,field:Scenario_Components',
@JamesTedrick: We'd love to see this available in a future version of the web form API, if possible!
For now, we're just going to modify the API code and self-host. In case anyone needs to have access to this parameter (or any other web form URL parameter not available in the Survey123WebFormOptions class), you can add:
const qqq = this.recalculate;
qqq && (t.recalculate = qqq);
to the getUrlQueryString() function of the Web Form API, then add a recalculate parameter to the web form instance in index.html, like so:
const webform = new Survey123WebForm({
clientId: 'uWqBqfybE4SWiQJL',
container: 'formDiv',
portalUrl: 'https://gis.example.com/portal',
mode: 'edit',
globalId: globalid,
itemId: '5780e99999904bb9b981b7a99999999',
recalculate: 'field:Reinspect_Status,field:Scenario_Types,field:Scenario_Components',
@JamesTedrick: We'd love to see this available in a future version of the web form API, if possible!