web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Wait for basic form to...
Power Pages
Answered

Wait for basic form to complete loading?

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

I'm having an issue when setting a multi-choice fields with selected options via JavaScript on page load. The issue occurs due to the choice control (multi-select) sometimes being a little on the slow side on page load and therefore my JavaScript is being called before the control has completed loading 🙄 I currently have it in a document.ready, but that doesn't seem to help too much. I could create a js interval to poll/hit the page for it appearing in the DOM but sounds a little rough. There must be a nice way?

 

Cheers,

 

$(document).ready(function () {
 if(PortalHelper.setMultiChoiceValues("gw_categories", [122880000,122880001])) {
 $(".log").append("setChoiceValues: OK<br/>");
 }
});

 

Categories:
  • Verified answer
    Fubar Profile Picture
    17 Super User 2026 Season 1 on at

    Not sure on this one.

    Could try window.onload (I believe doc ready fires before window.onload)

    Another way would be to work out something that is missing from the DOM until the control loads, then use a javascript mutationobserver to fire when it gets added to the DOM.

  • GWham1 Profile Picture
    on at

    Thanks @Fubar. I'll just poll the dom until its finished loading. Thanks.

  • Fubar Profile Picture
    17 Super User 2026 Season 1 on at

    FYI: Using a mutationobserver is usually a better solution than using an interval/timer.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
M Bilal Khan Profile Picture

M Bilal Khan 110

#2
sannavajjala87 Profile Picture

sannavajjala87 30 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 24

Last 30 days Overall leaderboard