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 / powerapps portal - cus...
Power Pages
Unanswered

powerapps portal - custom javascript

(0) ShareShare
ReportReport
Posted on by 15

Hi,

 

I am using Bootstrap Studio to create a web page for a PowerApps Portal and I am using some accordion component. It requires some JavaScript and I am not so sure how to make it work in the Portal of PowerApps. I know there is a Custom JavaScript section in the Web Content of a Web Page in the Portal Manager, but I haven't had much success in making the accordion work.

Anyone would know how to make it work?

 

Thanks

Categories:
I have the same question (0)
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    @Geradav 

     

    Could you describe more detail with your issue?

    Please refer to the following about how to write javascript to Portal webpage.

    https://www.cloudfronts.com/using-javascript-write-d365-crm-portals/ 

    If this still doesn't make sense, please share more information.

    Sik

  • Geradav Profile Picture
    15 on at

    Thanks @v-siky-msft 

    That confirms what I thought.

     

    I use Bootstrap Studio to generate web content for the Portal. It creates several JavaScript and CSS files. Integrating multiple CSS files in the Portal is fine. I was hoping we could do the same with JS files. Not sure I can put all the content of all the JS files in the "Custom JavaScript" field.

    I opted for hosting the files externally in a publicly accessible library and redirecting the scripts to that location.

    So far the portal works fine, but not sure what JavaScript code is used or not used.

     

    Power Apps Portal being a low-code/no-code environment I was hoping I could just drag and drop files generated by a third party application into the "web files" folder and having it work beautifully.

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    @Geradav 

     

    If you want to include JavaScript from your CRM instance, you need to upload as a web file. You can't easily include JavaScript that is uploaded as a Web Resource.

    - Create a web file for your JavaScript, and upload the note for it. If you are not able to upload the JavaScript file for any reason it is likely that the extension is blocked from being uploaded. You will then need to go to System Settings, and remove the .js from the list of blocked extensions.

    - In Content Snippets, create a new content snippet called Tracking Code, which will be included in the master page of the site. Add the script tag to the Tracking Code content snippet in the following way:

    <script type="text/javascript" src="/internal.js" />

    Hope this helps.

  • Geradav Profile Picture
    15 on at

    Hi @v-siky-msft 

     

    Thanks for your message.

    I haven't yet tried, but your reply corresponds exactly to my scenario and what I was looking for.

     

    Thanks

    Best regards

  • AutoEgoSS Profile Picture
    2 on at

    @v-siky-msft 

     

    Does a separate content snippet need to be created for each javascript file?

     

    When you state to add a "script tag" to the content snippet are you referring to the value field?

     

    Does the web file uploaded need to be named "internal.js"?

     

    Thank you for the help!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @AutoEgoSS - no, you can create just one content snippet and add all of your JS there. (it's better to have multiple and just add the snippet where is needed). 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
rezarizvii Profile Picture

rezarizvii 55

#2
11manish Profile Picture

11manish 48

#3
Valantis Profile Picture

Valantis 46

Last 30 days Overall leaderboard