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 Apps / Custom JavaScript not ...
Power Apps
Answered

Custom JavaScript not loading

(0) ShareShare
ReportReport
Posted on by 53

I have a Model Driven app where I want to have a custom button that opens a custom page.  I used the code from the documentation site for side panel pages inside a function.  That code isn't working and as I troubleshoot in the browser developer tools, the function and my JavaScript file aren't even being loaded.

 

This is how I have that button set:

mdenn_0-1686235100782.png

 

Do I need to put that file somewhere else or change a setting to have it loaded?  Is there something else I'm missing?  

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    Hi @mdenn - because there are several steps required to launching a custom page there could be several reasons it is not working. Could you share the link to the documentation you're following?

     

    Some checks:

     

    • Ensure you have published customizations and refreshed the page
    • Use static values first in your JavaScript to test
    • Doublecheck that your custom page is added to the model driven app and in the Solution. To make the code work you to have to add your custom page to the model-driven app via Add Page > Choose page > check or uncheck Show in Navigation > Publish app.
    • Use the logical name of the custom page as opposed to the display name in your code.

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • mdenn Profile Picture
    53 on at

    This is the documentation I was following for the side page.  https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/navigate-to-custom-page-examples#open-as-a-side-dialog

     

    The JavaScript isn't even getting into the app.  I'm more troubleshooting that, at this point than it functioning correctly or not.  It is referenced in the Model Driven app, in the same solution, and I can get to it in the Dynamics environment, when I click on the advanced properties of the web resource and try the URL there.  It is completely missing when the app is run though.  I was following through this video https://www.youtube.com/watch?v=DlyW8V3UMHk, but I can't even see the code there on mine.

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @mdenn - I appreciate there could be language differences, however I do not understand many of your comments.

     

    • "The JavaScript isn't even getting into the app. " - what does that mean?
    • What do you mean by trying "the url" ?

     

    I have watched the video but it is largely focused on debugging. If all you want to do is launch a custom page from a button, I would recommend a wonderful guide below from @mdevaney :

     

    https://www.matthewdevaney.com/power-apps-custom-page-modal-dialog-for-model-driven-apps/ 

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • mdenn Profile Picture
    53 on at

    When I search for the function in the dev tools, it isn't there, as you can see in this screen shot.  It is really frustrating to work with PowerApps when so much is obfuscated and hidden in the background orchestration of the apps.

    mdenn_0-1686312708447.png

     

    This is the URL that takes me to the file.

    mdenn_1-1686312934083.png

     

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @mdenn ,

     

    Let's go with couple of steps ensuring things are in place:

    1. When you created a JS (web-resource) -> Save and Publish customization.

    2. Where are you applying the JS? 

    A) Ribbon Button -> ensure you applied proper function name and library passed (Recommended: Use Ribbon WorkBench)

    B) If on Form -> ensure the JS library is added on Form and enable the JS action called with exact function Name.

    3. Once everything is set, publish once and refresh entire browser 4-5 times just to ensure you have latest customization on your App.

    4. Now, ensure your Custom Page is added to the App/Site-App that you are using in JS.

    5. Once everything is published, do a test now and check.

     

    Hope this helps

  • mdenn Profile Picture
    53 on at

    Is there a setting where the custom JavaScript could have possibly been turned off by an Admin or is there no way to do that?  Our Admins here have just turned a lot of things off, so if there is a way, maybe it is that.

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @mdenn ,

     

    JS can be turned off on Form level (option is there of enable or disable as checkbox),

    If you are using as button then the command can be removed or JS reference can be removed. 

     

    Note: If on Form level, JS is required to be added in Form library to ensure JS file is loaded.

    If JS is linked on Ribbon button then it will show in console page when button is clicked and not before that.

     

    Hope this helps

  • Verified answer
    mdenn Profile Picture
    53 on at

    ...so the JavaScript just started showing up.  I'm guessing something got stuck behind the scenes, since I didn't change anything.  I went through with my coworkers and now the file is there.

    mdenn_0-1686318976940.png

     

  • mdenn Profile Picture
    53 on at

    Another issue that I just wanted to add in incase anyone else has it and sees this later on, I founded that I couldn't get the popup to load until I added it to navigation and did at least one publish.  After that, I could remove it from the navigation.  Apparently, something needs to get wired up in the background that will only happen when it is added to the navigation.  I don't think that issue is documented.

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @mdenn - yup. See bullet point 3 in my initial response.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard