Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This tutorial will guide you on how to expose data in a CSV file as a data service by using the  Create New Data Service  wizard. We will create a data service that can search for data on the file.

...

  1. Click  Add New Datasource  and enter values as shown below. 
    Image Removed Image Added
  2. Follow the instructions below to fill the datasource details.
    • Datasource Id:  Enter an ID for you datasource. We will enter  CSV  as the datasource Id.
    • Datasource Type:  Select  CSV  as the datasource type from the list. You can now specify the details of the CSV file.
    • CSV File Location : Specify the path to your CSV file. In this tutorial, we are using a sample CSV file that is stored in the following location of your product distribution: ./samples/data-services/resources/Products.csv.
    • Column Separator: Add 'comma' as the column separator.
    • Start Reading From Row: Specify 2 to start reading from the second row.
    • Contains Column Header Row : Select Select true from  from the list.
    • Header row : Enter '21' as the value.
  3. Save the datasource. 
  4. Click Click Next to  to go to the the Queries screen screen.

Define a query for the datasource

...

  1. Click Add New Operation to open the following screen.
  2. In the  Operation Name  field, enter a name for the operation.
  3. In the Query ID  field, select the query that you created.
  4. Save the operation.

...