Sample Flows

This article presents some sample use cases your service might support. You are not limited to these exact flows, but they can serve as good starting points to help you plan your external database integration.

Query real-estate properties in an external database

Note: This sample flow requires the implementation of at least the basic functionality endpoints of this service plugin.

A real-estate agency stores information about the properties it manages in an external database. The agency has a Wix site and wants to make its properties available to its visitors. The agency implements the relevant endpoints of the External Database Service Plugin and hosts them at the https://www.<example-domain>.com base URL. It then creates a Wix app, configures it with the details of the service, and installs the app on its site. The site can then interact with the external database like this:

  1. On a dedicated search page, a site visitor searches for relevant properties with the following search and sorting criteria:

    • Locality: Springfield
    • Max number of rooms: 3
    • Price range: $550-$700
    • Sort: Low-to-high
    • Page limit: 3
  2. Based on the visitor's criteria, Wix Data automatically sends a Query Data Items request to the service endpoint hosted at https://www.<example-domain>.com/v3/items/query. The request body looks like this:

    Copy
  3. The endpoint responds with the relevant items, filtered and sorted as specified in the query. For example:

    Copy

    The site receives the data as if it were stored in a native Wix Data collection. It then parses the response and displays the results to the visitor.

Manage local job positions with an app

Note: This sample flow requires the implementation of the following service plugin endpoints:

A large employment agency maintains its job listings in an external database. The agency has several branches. Each branch operates in a different area and has its own Wix site.

To enable each branch to independently access and manage the job listings stored in the database, the agency implements the External Database service plugin and hosts it on the https://www.<example-domain>.com base URL. It then creates a private app and configures it with the details of the service. Each branch installs the app on its site to gain independent access to the database. Site visitors can then query, sort, and filter relevant listings on the site branch most relevant to them.

In this flow, a site visitor searches for open kitchen staff positions on a branch's site. After finding a relevant position, they browse for other listings by the same employer. Once filled, the branch closes the position.

  1. On a dedicated search page, a site visitor searches for open listings using the following search and sorting criteria:

    • Locality: North Utah
    • Sector: Restaurants
    • Position: Kitchen Staff
    • Show listing details: Job Title, Employer, Address, Hourly Salary
    • Sort: New-to-old
    • Page limit: 5
  2. Based on these preferences, Wix Data automatically sends a Query Data Items request to the service endpoint hosted at https://www.<example-domain>.com/v3/items/query. The request body looks like this:

    Copy

    The endpoint responds with the relevant listings, filtered and sorted as specified in the query. For example:

    Copy
  3. The site receives the data as if it were stored in a native Wix Data collection. It then parses the response and displays the results to the visitor.

  4. One of the listings retrieved by Wix Data is for a position offered by Hell's Kitchen. The visitor wants to check which other positions Hell's Kitchen offers. To do that, Wix Data sends a Query Referenced Data Items request to the service endpoint hosted at https://www.<example-domain>.com/v3/items/query-referenced. For each position listed by this employer, the visitor is interested in the job title, work address, hourly salary, and position status. The request looks like this:

    Copy

    The endpoint responds with all the job positions offered by Hell's Kitchen, filtered and sorted as specified in the query. For example:

    Copy
  5. The site receives the data as if it were stored in a native Wix Data collection. It parses the data, filters for positions whose status is OPEN, and displays the results to the visitor.

  6. The Hell's Kitchen branch on Old Nick Road hires a new employee for the kitchen staff position. The employment agency's branch then closes the position. To do that, Wix Data sends an Update Data Items request to the service endpoint hosted at https://www.<example-domain>.com/v3/items/update to update the position's status as HIRED. The request looks like this:

    Copy

    The endpoint responds with the updated item:

    Copy
Did this help?