How to show a loading form while an API runs?

How to show a loading form while an API runs?

Comments

  • Were working on a flow that waits on an API to run and redirects a user when it completes. We want to show a loading/processing screen or something of the sort so our users arent staring at a blank page and wondering whats going on. So far the only thing weve really figured out is the URL redirect and we cant figure out the other features, like how to get the form to automatically close.

    Any advice?

  • Hey Jon,

    Ive attached an example of something almost exactly like this.
    [img]att2[/img]

    This example consists of these parts:
    1) A form that waits on an API to complete - This has a data flow and an outcome rule that control the auto-close function.
    2) An async subflow - This would run your integration steps while the form waits for this to complete.
    3) An End Form Session step - The behavior is set to Open URL. This will end the form session and redirect to a chosen URL.

    The way this example works is by running the flow with your API as an asynchronous subflow. When it completes, a put value in cache step places a value into a cache you set up (you can configure or set up caches under System > Administration > Cache). A data flow on the form runs every 10 seconds and checks the cache for the key you added. When it finds it, it updates an invisible checkbox on the form that triggers an outcome rule and closes the form. The end form session step is set to Open URL which should navigate the user to the selected URL.

    Note that this is a loose example intended to demonstrate a rough concept and cannot be expected to work with an integration out of the box. Some configuration may also be required for this to debug properly on your end.
    [i]edited by Watson@decisions.com on 9/30/2019[/i]

Sign In or Register to comment.