Create a connector for a server script

In this topic, you learn how to create a connector for a server script.

The server script must return an array of objects with the properties name, label, and type.

Prerequisites

Procedure

  1. In the Cockpit, select the Connector tool.

    Result: A table with all the connectors is shown.

  2. Select Create.

    Result: The Create Connector dialog opens.

  3. In Name, enter a meaningful name for the connector.

  4. In Data Source, select Server Script.

  5. In Setup Selection and Fields, select the server script that specifies the selections and fields in an adaptive application.

  6. In Run, select the server script you want to create a connector for.

  7. Package, assign the connector to a development package of artifacts.

  8. Select Create.

    Result: You start in the General tab of the connector.

  9. In Description, enter a meaningful description.

  10. Go to the Data Source tab.

  11. If you want to see a preview of the data when selecting the connector in the Adaptive Designer, select Enable Preview. (Learn how to use that in the following Use the preview section)

  12. In Setup, select the server script that specifies the selections and fields in an adaptive application.

  13. In Start Parameters, add parameters that the server script expects, if any.

  14. In the Documentation tab, enter information about the connector and server script.

  15. Select Save.

Results

  • Your connector is saved with the current settings. The Connector tool adds an ID to your connector and saves change dates.

  • The Connector tool adds the Field Catalog tab that shows the properties imported from the server script.

  • Your connector is now available when creating an application.

Use the preview

  1. Go to the Connector tool.

  2. Select an API connector from the table.

  3. Toggle to edit mode.

  4. Go to Data Source, select Enable Preview, and Save.

  5. Go to the Adaptive Designer.

  6. Select Create.

  7. To show the list of connectors, in the Create dialog, select Connector.

  8. Find the connector and select the (Preview) icon.

    In the Adaptive Designer guided mode, you can select a connector and see a preview of the connector, if available, in Step 2 Data.

Override Field Catalog

By selecting the toggle Override Field Catalog you can adjust the returned field catalog from a server script or a table type connector. This is useful for hiding fields or editing the field catalog.

Fields can be moved between Input/Both/Output by dragging and dropping or by selecting the (Glasses) icon and changing the Usage property.

With Override Field Catalog, you can also change the name and description that will appear in the Adaptive Designer, as well as the field type.

You can also add new fields to the field catalog. These will take values from the chosen Original Field. This is useful for when you need the same field to be displayed in multiple places, common cases being where you need to format the same data in two different ways. This is necessary because the Adaptive Designer can only add one instance of a field catalog field to a given Input/Output section.

By deleting a field here, it will not be usable in the Adaptive Designer, and it will not be returned when the connector is called. This is useful for sensitive data.

By selecting the toggle button again, you can reset the field catalog to its original state.