Auto-Saving Form Data Every 30 Seconds in Appian Portals – Is a!toJson() Supported

Certified Senior Developer

Hi Community,

I'm exploring a lightweight auto-save strategy for a Portal form and would appreciate some guidance.

Warning️ 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).

  • Hold all inputs in 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).

  • On form reload, use the draftId to fetch and restore the saved draft using a!fromJson().

Mag My questions:

  1. Is a!toJson() / a!fromJson() supported and reliable in Portals?

  2. 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

Parents
  • 0
    Certified Lead Developer

    It looks like a!toJson() is not compatible with portals: https://docs.appian.com/suite/help/25.2/fnc_system_a_tojson.html

    As far as auto-save scalability, the answer is (unfortunately) "it depends". How many users are there? How complicated is the form data that's being saved? Is the user ok with incomplete auto-saved information? Will your internal Appian users understand what incomplete information looks like? In ideal scenarios, it is likely ok to auto-save every 30 seconds, supposing you can get the underlying mechanisms working properly.

    Timeout issues are a function of overall Appian system load, how deep the activity chain goes on any processes triggered by the API, and general best practices in writing performant code.

Reply
  • 0
    Certified Lead Developer

    It looks like a!toJson() is not compatible with portals: https://docs.appian.com/suite/help/25.2/fnc_system_a_tojson.html

    As far as auto-save scalability, the answer is (unfortunately) "it depends". How many users are there? How complicated is the form data that's being saved? Is the user ok with incomplete auto-saved information? Will your internal Appian users understand what incomplete information looks like? In ideal scenarios, it is likely ok to auto-save every 30 seconds, supposing you can get the underlying mechanisms working properly.

    Timeout issues are a function of overall Appian system load, how deep the activity chain goes on any processes triggered by the API, and general best practices in writing performant code.

Children
No Data