Query Used on Page Reminder

It would be nice to have a popup that displays pages using the query when a query is selected in the Server Actions panel. As a site grows, maintaining your queries (preventing duplication, overwriting, deletion, etc.) can become problematic.

That’s where having a well organized structure of meaningful folders and sub-folders comes in handy. :wink:

2 Likes

I was thinking of doing this. But here’s a question… can I mimic my website pages under the Server Actions panel and make each page a folder (that is using a Connection and/or a query or other Actions) to display what actions are affiliated with each page? For example: “page1” (which represents a webpage on the site) as a folder that uses query1 and “page2” as a folder that also uses query1 and a query2, etc., etc.

Could I copy ‘query1’ into the “page2” folder or would I have to re-create it?

Or am I totally missing how Wappler assigns organization to its Actions?

If you reuse the same server action on multiple pages, I see no logical reason to define the same thing mutiple times. Just define it once and reuse it as many times as needed on as many pages as needed.
That’s the idea behind server actions - define it once and reuse it multiple times on multiple pages.

You can definitely organize your actions that way. You can’t copy actions though. Nor would I advise it. But they way you have it organized in your screenshot is a perfectly good way to go. That is basically what I have done in my screenshot. I just added sub-folders with in each page, one for forms and one for lists/queries.

You will find that good organization of your actions will save you a lot of trouble.

Yeah, I’m seeing that already. I like what you’re doing and will organize my Action panel accordingly. This will help to prevent a late night disaster. I’ll place all my Actions in a separate folder (as I 'm already doing) and just dummy-list it if it’s being used in that page’s folder. Thanks, Brad.

1 Like

I’d suggest a more feature oriented server action grouping method. This way you won’t have to create the same query multiple times for each page using it. A simple example:

  • CMS
    • Users
      • List
      • Insert
      • Update
      • Delete
    • Products
      • List
      • Insert
      • Update
      • Delete
  • Website
    • Products
      • List
      • Details
    • Events
      • List
      • Details
        …etc.

So for example on the front end no matter on how many pages you list your products, you will always refer to a single server action: website > products > list and updating multiple pages would be easier when you have to update only one server action.

5 Likes

That’s what I’m doing right now - wish I’d thought about this sooner… :neutral_face:

1 Like