Data privacy notice

 

When this content is loaded, usage information is transmitted to Vimeo and may be processed there.

 

             

Pre-render

Modified on Mon, 16 Jan, 2023 at 10:58 PM


Interface IPluginFormPreRender

Position of pre-render plugins in FORMCYCLE's program flow. They are run before the form is rendered and sent to the user's browser. FORMCYCLE


Use cases

  • Providing the form with data from external data sources or web services
  • Prefilling form fields
  • Preventing forms from being sent to the user


When multiple pre-render plugins are installed, their order of execution is arbitrary. You should not rely on a certain fixed order.


Pre-render plugins are run for all forms of the client they belong to, or for all existing forms when installed as a system plugin. We recommend you check whether the plugin should be executed for the current form, for example by defining a plugin property containing a list of allowed forms.


Method signatures

IPluginFormPreRenderRetVal execute(IPluginFormPreRenderParams params) throws FCPluginException

Transfer values: The IPluginFormPreRenderParams type provides the following properties:
Access to the form request context (IFormRequestContext) and thus to central objects such as:
  • process
  • project
  • form
  • version
  • session parameters
  • current user context in order to be able to perform database operations, for example
  • client

Return values: The return value must be of type IPluginFormPreRenderRetVal, a reference implementation is provided by the class PluginFormPreRenderRetVal.The object enables the transfer of a serialisable JSON object, which is available after delivery of the form to the browser, under the plugin name, in the form variable XFC_METADATA.Furthermore, setting the value map can cause fields to be pre-filled when the form is rendered. These values overwrite existing values if necessary and also replace values from URL parameters.If the plug-in is not processed correctly, an FCPluginException is thrown.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article