Hi Community,
I'm exploring a lightweight auto-save strategy for a Portal form and would appreciate some guidance.
️ I understand that triggering a Web API on every keystroke or field update is not supported or scalable in Portals — totally agree with that.
Here's the approach I'm considering:
On initial form load, generate a draftId (UUID) and store it (via URL or localStorage).
draftId
localStorage
Hold all inputs in local!formData.
local!formData
Every 30 seconds (or on key actions like tab change or “Save Draft”), send a full snapshot of the form to a Web API using a!toJson(local!formData).
a!toJson(local!formData)
On form reload, use the draftId to fetch and restore the saved draft using a!fromJson().
a!fromJson()
My questions:
Is a!toJson() / a!fromJson() supported and reliable in Portals?
a!toJson()
Can we safely trigger a Web API every 30 seconds to save the form data? Any performance or timeout issues to consider?
Discussion posts and replies are publicly visible
harishbabub6381 said:Is a!toJson() / a!fromJson() supported and reliable in Portals?
Not supported directly in Portal interfaces. Instead, send your form data as maps from the Portal and convert to/from JSON inside a Web API that the Portal calls.
harishbabub6381 said:Can we safely trigger a Web API every 30 seconds to save the form data? Any performance or timeout issues to consider?
Calling a Web API every 30 seconds for auto-save is supported and Portals auto-scale to handle traffic. To reduce load, consider increasing the interval to 60 seconds. Use URL parameters for storing draftId since localStorage isn’t available in Portals.https://docs.appian.com/suite/help/25.2/portals-security.htmlhttps://docs.appian.com/suite/help/25.2/portal-capabilities.html