Data privacy notice

 

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

 

             

Data source

Modified on Mon, 17 Jul, 2023 at 8:55 AM

After the plugin has been installed, go to the FORMCYCLE Designer and add a form element of type select. You can then select the plugin as the data source in the values panel.


Interface IPluginDataSource


Position of data source plugins in FORMCYCLE's program flow. They are run during the form rendering process.


Use cases

This type of plugin can be used to provide select fields with custom data from external web services, such as a list of countries, zip codes, etc.

Method signature

IPluginDataSourceRetVal resolve(IPluginDataSourceParams params) throws FCPluginException

Parameters

The method resolve is passed an object implementing IPluginDataSourceParams, which contains getters for the following properties:

  • Projekt
    The form for which this plugin has been called.
  • Mandant
    The client to which the form belongs to.
  • SessionAttributes
  • RequestParameters


Return value

The method must return an object implementing IPluginDataSourceRetVal. The class PluginDataSourceRetVal provides a reference implementation.

This object allows you to return a serializable JSON array containing the value that should be shown in the select field. The array must consist of objects, each object must contain the properties text and value. The text is what is displayed as the text of the select option, the value is the value that is sent when the form is submitted. Optionally, the object may also have the property title, which is used as the title attribute of the select option.

The exception FCPluginException will be thrown when an exception occurs while the plugin is being processed.

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