Previous Page Next Page

Lists are collections of documents stored in Domino view design elements. This part of the tutorial will create two Domino views.

Create Customers Lists

Customers By Name List

  1. Hover over the Domino-REST-API-NewDB collection name and click on the ellipsis (three dots). Select Add Request.
  2. Name the request customers list and click Save.
  3. Change the method from GET to PUT.
  4. Set the URL as {{SETUP_HOST}}/design/views/Customers?nsfPath=customers.nsf.
  5. On the Headers tab, add a HTTP request header called Authorization with the value {{bearer}}. This maps to the bearer collection variable we set from the authenticate request.
  6. Add an HTTP request header Content-Type set to application/json.
  7. On the Body tab change the type to Raw and also change the type from Text to JSON.
  8. Set the request body content to:

     {
       "name": "Customers",
       "selectionFormula": "SELECT (Form=\"Customer\")",
       "columns": [
         {
           "name": "name",
           "title": "Name",
           "separatemultiplevalues": false,
           "sort": "ascending",
           "formula": "name"
         },
         {
           "name": "category",
           "title": "Category",
           "separatemultiplevalues": false,
           "sort": "ascending",
           "formula": "category"
         },
         {
           "name": "address1",
           "title": "Address",
           "separatemultiplevalues": false,
           "sort": "ascending",
           "formula": "address1"
         },
         {
           "name": "address2",
           "title": "Address",
           "separatemultiplevalues": false,
           "sort": "ascending",
           "formula": "address2"
         },
         {
           "name": "city",
           "title": "City",
           "separatemultiplevalues": false,
           "sort": "ascending",
           "formula": "city"
         },
         {
           "name": "state",
           "title": "State",
           "separatemultiplevalues": false,
           "sort": "ascending",
           "formula": "state"
         },
         {
           "name": "zipCode",
           "title": "Zip Code",
           "separatemultiplevalues": false,
           "sort": "ascending",
           "formula": "zipCode"
         }
       ]
     }
    
  9. Click Send to make the request.
  10. Save and close the request.

Active Customers List

  1. Hover over the customers list request and click on the ellipsis (three dots). Select Duplicate.
  2. Open the duplicated request named customers list Copy, rename it to active customers list and click Save.
  3. Change the URL to {{SETUP_HOST}}/design/views/Active%20Customers?nsfPath=customers.nsf.
  4. On the Body tab set the request body content to:

     {
       "name": "Active Customers",
       "selectionFormula": "SELECT (Form=\"Customer\" & status=\"Active\")",
       "columns": [
         {
           "name": "name",
           "title": "name",
           "separatemultiplevalues": false,
           "sort": "ascending",
           "formula": "name"
         },
         {
           "name": "category",
           "title": "category",
           "separatemultiplevalues": false,
           "sort": "ascending",
           "formula": "category"
         }
       ]
     }
    
  5. Click Send to make the request.
  6. Save and close the request.

Setting separatemultiplevalues to true will display the same document multiple times in the list, once for each value in that field. This option will typically be used in lists indexed specifically by those fields.

Note

For Domino REST API, lists have to explicitly be enabled for use. This provides flexibility for other methods of access to the NSF, e.g. Notes Client. It also provides the ability to create different database configurations for different audiences.

Congratulations!

This request has:

  • Created a list of Customers by name.
  • Created a list of only active customers.
Previous Page Next Page