Onlyoffice form input to database

Hello @Racer_X
Please describe the situation in detail, step-by-step. Do I understand it right that you created your own plugin to collect data from .oform files?

Hello, i’ve wrote a plugin to get the data form the oform, but i cant get it to trigger on the oform file. is there a option to embed a button on the oform file to trigger the plugin?
i can only test my plugin from the docxf file in the plugins tab.
Thanks in advance.

1 Like

https://api.onlyoffice.com/plugin/executemethod/form

you should find what you need here.

Hello @edlacer
Sorry for the late reply.
You have to use the methods from mentioned link.
Would you mind describing the desired scenario in details? If it’s possible, you can record a videofile or draw a scheme. Do I understand it right that you want to implement custom button outside of editor frame to trigger your plugin?

This is the core of my plugin, right now im triggering it via the onclick event, and the autostart option but i would like a specific option to trigger.


The custom button would be great since the plugins tab is missing in the oform interface
Thanks in advance

@Alexandre


i’m looking for something like this. i achieve this by adding a button in the html of the plugin and by modifying the style of the iframe with the inspect element tool. but i cant do it via javascript

Hello @edlacer
We’re checking the situation. I will update this thread when we have something to share.

Thanks.
imagen

Alternatively do you know if i can trigger the plugin from the submit button ?

Alternatively do you know if i can trigger the plugin from the submit button ?

Is it button from editor interface? Please point me to it.
As for the situation in general, we’re still looking into it. I will update this thread when we have something to share.

it is, it shows up when the attribute submitForm is set to true in the customization object of the config parameter

Where did you get this description and parameter? Official guides don’t contain them: ONLYOFFICE Api Documentation - Config

i didnt find in the guide, i found it checking the source code of the python integration example
ONLYOFFICE Api Documentation - Language-specific examples found in the link.
I’ve tried the parameter outside of the python app and the parameter works, so its not exclusive to python

The parameter is found in Python Example/src/views/actions.py approximately in the line 287

You needn’t have used this parameter. It’s a new parameter (recently added), but we didn’t test it properly yet and there’re no official documentation at the moment.
Please accept our apologies for this situation.

As for the situation in general (plugin trigger in .oform files), we’re looking into it. I will update this thread when we have something to share.

i’ve sort of figured it out
What i do to make the custom button show up is:
From the index.html of the plugin

  1. Get the parent iframe (the editor)
  2. With the parent iframe object get the plugin iframe (identified by the asc.{uuid-code})
  3. Modify the style of the plugin’s iframe to make the button show up
<script>
 let parentframe = window.parent.parent.frames[0]; //get editor iframe

 parentframe.document.getElementById('iframe_asc.{pluggin uuid-code}').style="custom css to place the button wherever i want"; // get plugin iframe and change its style
</script>

Result:
button result

We’re glad that you managed the situation. Please feel free to contact us if you face any difficulties.

BTW, what’s the idea behind the “submitForm” button?

Looks like the forms API documentation might’ve moved to here: ONLYOFFICE Api Documentation - Structure of a form

Hello @msilveira
We recently discussed it in the same thread: Onlyoffice form input to database - #23 by Alexandre
Unfortunately, there’s no official documentation at the moment.

Hello @Short-Stay
That’s right. The correct links of mentioned methods:
https://api.onlyoffice.com/plugin/executemethod/text/getallcontentcontrols
https://api.onlyoffice.com/plugin/executemethod/text/getcurrentcontentcontrol
https://api.onlyoffice.com/plugin/executemethod/form/getallforms

Hello, I hope you can guide or assist me as the case may be to determine the feasibility of my project in an OnlyOffice format. I want the information filled out to be saved in a PostgreSQL database, and when that information is modified, it should be reflected in the database as well. Additionally, I’d like the document to be available for future reference for individuals not familiar with databases.

Hello @paco_luna
Just to add a few words. Unfortunately, we don’t have ready-to-go solution for this request. But it seems that case is feasible, because there’re necessary methods to get a data from forms. However, we are working to provide samples for most usage scenarios as a guideline. I hope we will add step-by-step sample for this scenario one day.