cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Geradav
Level: Powered On

powerapps portal - custom javascript

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

6 REPLIES 6
Microsoft v-siky-msft
Microsoft

Re: powerapps portal - custom javascript

@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
Level: Powered On

Re: powerapps portal - custom javascript

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.

Microsoft v-siky-msft
Microsoft

Re: powerapps portal - custom javascript

@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
Level: Powered On

Re: powerapps portal - custom javascript

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
Level: Powered On

Re: powerapps portal - custom javascript

@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!

mirceam
Level: Powered On

Re: powerapps portal - custom javascript

@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). 

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (9,366)