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
- Hover over the
Domino-REST-API-NewDBcollection name and click on the ellipsis (three dots). Select Add Request. - Name the request
customers listand click Save. - Change the method from GET to PUT.
- Set the URL as
{{SETUP_HOST}}/design/views/Customers?nsfPath=customers.nsf. - 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 theauthenticaterequest. - Add an HTTP request header Content-Type set to
application/json. - On the Body tab change the type to
Rawand also change the type fromTexttoJSON. -
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" } ] } - Click Send to make the request.
- Save and close the request.
Active Customers List
- Hover over the
customers listrequest and click on the ellipsis (three dots). Select Duplicate. - Open the duplicated request named
customers list Copy, rename it toactive customers listand click Save. - Change the URL to
{{SETUP_HOST}}/design/views/Active%20Customers?nsfPath=customers.nsf. -
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" } ] } - Click Send to make the request.
- 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.