Category: How do I do X?
Resource links
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

How Do I Show Modal Onpage Load?

Issue

As a member of the community, I am wondering how I can show a modal on page load.

Resolution

To display a modal when the page loads, follow these steps:

  1. Create a JSObject and add a function showModalOnPageLoad() with the following code. Replace 'Modal1' with the name of your modal:

     
                   export default {
                     showModalOnPageLoad() {
                       showModal('Modal1');
                     }
                  }
               
  2. Click the Settings tab in the JS Object and toggle the button under the Run On Page Load attribute for the showModalOnPageLoad function. This will ensure the function runs automatically when the page loads.
  3. Deploy your app and test it to confirm that the modal displays as expected when the page loads.