Data sources

This guide describes the functionality available in the Flexmonster server when working with data sources.

To manage data sources, go to the Data sources tab in Flexmonster Admin Panel:

The view with all data sources

Add a data source

To create a new data source, select the Add data source button. The following view will appear:

The view to create a new data source

Each data source has the following configurations:

  • Name. Unique identifier of the data source. It will be necessary to configure the connection on Flexmonster’s client side.
  • Type. Data source type: JSON or CSV.
  • Source. Defines whether the data source will be loaded from a file or a URL.
  • Path to file. The path to the local file with your data. You can select Open to open a file manager. This config is shown only when the Source is set to File.
  • URL. The URL to your data. This config is shown only when the Source is set to URL.
  • Has header. Indicates whether the data contains field names. Keep this config’s default value if:
    • Your CSV data contains a row with field names.
    • Your JSON data is in the array of arrays format, and the first array contains field names. Otherwise, disable the Has header config.

In addition, the following configurations are available for the CSV data source type:

  • Delimiter. The field delimiter.
  • Decimal separator. A character that separates decimal parts of numbers. For example, if commas separate decimal parts of numbers in your data (e.g., 3,14), set the decimal separator to ,.

When the data source configuration is complete, select Save changes.

Configure schema

By default, the Flexmonster server autodetects all field types. Using the Schema config, you can explicitly set data types for fields in your data. This config becomes available after a data source is added to the server.

To enable the schema:

  1. Go to the Data sources tab.
  2. Select the data source to enable the schema for.
  3. In the Data source details view, enable the Schema toggle.

You can now choose field types from the drop-down menu: String, Integer, Double, Number, Boolean, Date, Date & Time, or Time.

Choosing field data types in the schema configuration

If you disable the Schema, your adjustments will be deleted, and autodetected data types will be used.

To apply the schema configuration, select Save changes.

Edit or delete a data source

To edit a data source, select the data source’s name or the Show details. The following view will appear:

The view to edit or delete a data source

Make the necessary changes. Note that you cannot change the data source type.

Select Save to apply the changes or Cancel to discard changes.

To delete the data source, select Delete data source. Before deleting, you will be prompted to confirm the action.

Disable a data source

Each data source can be disabled by selecting the Disable button:

Disabling a data source

Note that disabled data sources cannot be used on the client side.

Check Status to make sure the data source is disabled.

To enable the data source, select Enable.

Reload data

Select the Reload button to refresh the data in the data source manually: Reloading a data source

As a result, data in the data source will be updated.

Reload is not available for disabled data sources.

Possible data source statuses

  • Enabled — means that the data in the data source is loaded and available for use on the client side.
  • Disabled — means that the data source is not available on the client side; the server also does not keep data for disabled data sources in its memory and does not reload it.
  • Pending — means that data for the data source is being loaded.
  • Failed — means that the server could not load the data, for example, due to an access or parsing issue. Check data source details or server logs for more information.
  • Not loaded — appears when the server is stopped.

See also