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 / JavaScript library CDN...
Power Pages
Answered

JavaScript library CDN only works in modal entity form when logged in as an administrator

(0) ShareShare
ReportReport
Posted on by 22

I set up a modal entity form that needs multi-select capability so I added CDN references to "select2" in my page and used it in the Entity Form's custom JavaScript. This was working great for me in one environment but when I moved it to a new environment, it didn't work. The first environment my account had the Administrator web role, but the second one did not. I can recreate this issue every time by removing the Administrator web role.

 

I can also see in the sources in the browser that when I'm an Administrator, there's a reference created to /js/select2/select2.min.js in my *.powerappsportals.com. I don't have a folder and I didn't set this up. I also don't see that when I take away my Administrator role. I'm assuming maybe that is caching, but I don't understand why this works as an Administrator and not when I take away that web role from my account.

 

The CDN style and script I'm linking to are here: Installation | Select2 - The jQuery replacement for select boxes It works great anywhere else too, it just doesn't work on this modal entity form unless I'm an Administrator. This is baffling me and I need this functionality to work for other users.

Categories:
I have the same question (0)
  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @QuantumRemedy,

     

       I am not sure this will help you. Select2 is really a good library and it has nice components to utilize. Probably because it is JS CDN, by default .JS extension is blocked in Portal. So I am thinking that is the reason it is expecting an admin role in your entity form.  There is a high chance of vulnerability and an injection attack can occur if you enable .js extension in the portal. Maybe I am wrong here. 

     

    An alternative approach if you are interested.  I use bulma.css in our portal a lot. Most of the components can work just with CSS only which is fab and makes your job easy. Adding the post reference below. 

     

    https://powerusers.microsoft.com/t5/Power-Apps-Portals/Portal-Theme-Bootstrap-Version/m-p/792736 

     

     

    Hope it helps. 

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

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

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

    Not aware of this issue,  but a possible workaround is rather than doing it directly on the Entity Form, did you try putting it in a Web Resource embed the Web Resource on your entity form and then set the render Web Resources setting on the Entity Form definition.   (we do a Google address typeahead lookup in this manner and then update address fields on the main Entity Form when the user selects a value)

     

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 Pages

#1
Fubar Profile Picture

Fubar 47 Super User 2026 Season 1

#2
SP2019admin Profile Picture

SP2019admin 20

#3
Mohsin Ali Profile Picture

Mohsin Ali 19

Last 30 days Overall leaderboard