Import Server Connect Actions to other Projects?

A quick idea. Having the ability to import Server Connect Actions in to other Projects within Wappler. Feasible (as a Feature Request) or a silly idea? Not connecting to them from within one Project to another Project, actually importing them in to SC API area of another Project.

:slight_smile:

1 Like

It’s been requested before. I think there is a FR for this. And yes. Makes sense at least for me where I try to design them in a way I can reuse in other projects.

1 Like

Same here @JonL

One issue I could see, unless there’s a simple way around it, would be globals. I can see users importing server actions that are linked to globals outside of the project, could cause a few hiccups.

I am guessing the import/export option would handle that. I saw this request more than just copying the json file from one location to another one.

So something like and import/export wizard where you choose what you want to export(SCs, globals, etc)

Similar to a mysql dump where you select only structure, data, drop if exists, etc

2 Likes

Well just importing server actions might not be that much easy as they depend on database structure and also other relations like globals and library.

So you should have the same structure in the other project to make it work…

That’s what I feared you would say

For us in the majority of circumstances Globals remain the same. As with DB’s (could easily be selected from the Connection drop down). We just find ourselves, like Jon, recreating a lot of the same Actions across Projects. Its not mega important as in the majority of circumstances (same site architectures of course, PHP in most cases, currently) we’ll just copy across Actions from other Projects (no biggy or hardship there). Was simply a brain fart (this quarantine thing has spawned a spate of boredom leading to all sorts of hair-brained ideas unfortunately).

There are a couple of related suggestions which have cropped up in the past, in particular, copy/pasting or dragging files from the OS File Manager into Wappler. An import process where the imported file may or may not work is problematic. A more convenient way to copy files between projects, while leaving the responsibility more to the developer, might be a good solution. I would find this very useful anyway - not just for SA API files.

Another related idea is a snippets facility. If such a feature could be made either global or project-specific, it would particularly useful. This has been a feature request for a long time, with a good number of votes.

1 Like

In the query builders, we have a great UI for managing tables & columns which are not found.
Maybe Wappler can make use of the same logic and when a server action is being imported, a similar popup could be shown for all types of applicable Globals which do no match in the current project. The user can then have the option to:

  1. ignore the warning
  2. change it to something the current project has via drop down
  3. remove that piece of code
2 Likes

Adding my perspective…

I quite often keep a record of a Server Action in a visual form (Word document) so that I can refer to it later, to help with debugging or use it to help create a new (similar) Server Action. But the process can be quite long-winded for a complex Server Action.

I note the Server Action location and name and put that in the Word doc.

image

I screenshot the whole Server Action, this can end up being many screenshots.

Sometimes I will go into each step, copy the property details and paste that into the Word file.

I will then open the Server Action in Wappler using the ‘Open in Editor’ button. I will then copy each Query into Word.

There I have a macro set-up to do a lot of stripping out and formatting so it can be easier to view/read.

This is just what I do to help me. Am I the only one that does this?

I would love to be able to copy this…

A simple solution to some of this could be just plain simple copy and paste of a selected set of server action steps between server actions…

Do you mean copying the code directly or via the steps as they appear in the UI? I wouldn’t have thought either was simple, at least from the point of view of getting something which would be useable at the other end. I always copy whole files and tweak them in the destination project. I would have thought this would be simpler - but I don’t think there can be a simple solution.

I too usually just copy paste.
The beauty of Wappler is that no matter the server model, the server action is just a big JSON.
And its not that hard to read either.
So, I just either copy the whole JSON over.. or copy just the JSON object of steps that are required.
Haven't encountered any issue with it so far.

But, like I mentioned above, a UI similar to query builder issue resolution would be a great addition with an import option.

copy&paste of server action parts in the UI is an old request and would still be VERY useful.