Category: How do I do X?
Resource links
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

How Do I Share (Not Copy) My JS Between Pages?

Issue

I am having difficulty sharing a JavaScript library between pages in my app. While I can use the "COPY TO PAGE" and "MOVE TO PAGE" options, this means I have to manually update each page when the library is tweaked. I would like to have a common code library for data mapping and other functions, but currently, actions are page-specific.

Resolution

All actions (API, DB Query, JS functions) created within an Appsmith application are page-scoped. This means that they are only accessible from within the page and not across pages within the same application. On our free plan, you need to copy them to each page.

However, on our Business Edition, we provide the Packages feature, which allows you to reuse widgets, queries, and JS logic across your applications.