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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Upload a large JavaScr...
Power Pages
Unanswered

Upload a large JavaScript file to Portals?

(0) ShareShare
ReportReport
Posted on by

How do I upload a large JavaScript file to Portals (Web Files or similar)?

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    Hi @Anonymous ,

    is it a react file? if not then there are multiple ways to do that depending on your use case, the most recommended way is to use snippets (chop your codes into features and call them in the web page js section or web template)

  • Community Power Platform Member Profile Picture
    on at

    It is a large (vanilla) javascript file. How do I upload a large javascript file?

  • Community Power Platform Member Profile Picture
    on at

    @Anonymous  then web file is your choice. In one project we needed to use react so we built everything in VS , complied it in one js file then and upload it as app.js as web file 

  • Community Power Platform Member Profile Picture
    on at

    I tried again to save the contents of my large javascript file as a content snippet and it worked. 

     

  • Community Power Platform Member Profile Picture
    on at

    -

  • Community Power Platform Member Profile Picture
    on at

    Perfect @Anonymous , you probably know that but you can call it in any place that accept html like web page using below codes

     

    {% include 'snippet' snippet_name:'YourSnippetName' %}

     

    Manar_0-1641923191190.png

     

    Please mark it as accepted solution so others can benefit from it as well !

  • Community Power Platform Member Profile Picture
    on at

    So, to be clear

     

    We are saying that javascript files of all sizes can be saved to Content Snippets?

     

    And after saving the js file to a new Content Snippet, one should add the file to the Web Page via the following

    {% include 'snippet' snippet_name:'YourSnippetName' %}

     

    What about Web Files? or Child Pages?

     

    Why does the Content Snippet offer only "Text" or "HTML"?

     

    It seems the logical place for a JS file would be as a Web File.

     

    At present, uploading a large JS file as a Web File creates the following error

    You have exceeded the maximum number of characters in this field. 

     

    I also do not see an upload button within the Notes section of Web Files.

     

    A web file represents downloadable file in a portals website, used to store images, documents, and any other file type.

     

    Create and manage web files - Power Apps | Microsoft Docs

  • Community Power Platform Member Profile Picture
    on at

    @Anonymous  thats right , so think about it as 2 options to deal with large js:

    1- use content snippet, to call it use {% include 'snippet' snippet_name:'YourSnippetName' %}  anywhere html is supported 

    2- use web file , to call it use <script type="text/javascript" src="/YourJSFileName.js"> </script> anywhere html is supported 

    Manar_1-1641927086143.png

    ref this useful video Min 14 and after

    https://www.youtube.com/watch?v=vABWmnZQYQA 

     

     

  • Community Power Platform Member Profile Picture
    on at

    Ok, so that is how to call the file.

     

    How does one upload a large js file to Web Files without encountering an error?

  • Community Power Platform Member Profile Picture
    on at

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard