Can you add or copy a server connect / API action to the library?

Hi all

Maybe I am missing this somewhere.

Is there a way to copy an existing action to the server connect library?

Sometimes you work on a process or maybe there is an existing process and you realise it will be a much better candidate to add to the library. Is there a way to add an existing action to the library rather than rebuilding it in the library?

Thanks!

2 Likes

There isn’t any copy/move actions to library yet, but it is a good idea!

5 Likes

Just to add that it was easy enough for me to do but for the scheduled items instead of the Library…might be the same process though.

I found it much easier to build the API steps in a normal server connect file to test it, then copy into the Scheduler to automate it.

How I did it:
Set up API steps as normal
Create a new schedule API, including adding a dummy step.
Open up the normal API file in the editor, copy everything in the exec group and override the equivalent in the API file in the Scheduler.

Worked for me.

1 Like

Thanks @Philip_J

First thing I tried to do was right click and drag the action into the library in the server view, then I tried to right click on an API action to see if there was a “Copy to library”

Just lazy :stuck_out_tongue_winking_eye:and no doubt I will delete or overwrite something if I start playing with the files.

I have to admit this would make my life far easier too, pretty often you start thinking its just a normal server action and later on it needs to be a library server action.
Would make life far simpler if there was a way to move these.

5 Likes

Yep!!!

It could just be as simple as a drag and drop in the project folder view @George ?

Or copy and paste…

I am sure there is some behind the scenes reference file changes going on but this would save so much time.

1 Like

I’ve been able to hack this for ages @StevenM

It works for 3.9.x but I’ve not tried it for 4.x

  1. Duplicate the Server Action.
  2. Remove all get and put parameters.
  3. Locate the source .php file and move it to the directory containing the libraries. (Am on my phone so don’t have those directory names to hand)
  4. Open the new library file in Wappler.
  5. Add new parameters as required.

You should find it now behaves as a library action.

It is totally unsupported and I’ll probably get some flack for writing this here, but I have quite a collection of library actions and I created almost all of them this way!

2 Likes

I do the same thing, but I pretend I don’t, because its naughty.

2 Likes

Very naughty @psweb.

Go and stand in the corner with your hands on your head…

2 Likes

I need this. move back and forth and then do modifications to make it work. Pls make us lazier.