This QuickStart demonstrates how to implement a default workbook selection feature for embedded Sigma content using the Sigma API and local storage.

Each user can set one preferred workbook that will automatically load whenever their account is selected. They can also clear their default selection or change it at any time from the list of workbooks they have permission to access.

REST API Usage 01: Getting Started

For more information on Sigma's product release strategy, see Sigma product releases

If something doesn't work as expected, here's how to contact Sigma support

Target Audience

Developers who want to use Sigma's REST API to programmatically control Sigma in an embedded context.

Prerequisites

Sigma Free Trial

Download Visual Studio Code

Footer

Start the Express server in terminal from the embedding_qs_series_2_api_use_cases folder and enable debugging:

DEBUG=true npm start

The server is ready when it displays: Server listening at http://localhost:3000.

Browse to the landing page:

http://localhost:3000

Select the Set Default Workbook page and click Go.

Select the View user.

Click the black arrow to open the workbooks list, then select the Plugs Transactions workbook.

Footer

Click Set Default. The button will turn red, and its label will change to Clear Default.

In the workbook list, the Plugs Transactions workbook will now have (Default) appended to its name.

A new record is written to the lowdb JSON database to reflect this setting:

Clear default

Click Clear Default for the View user and refresh the browser.

Reselect the View user to verify that no workbook is loaded until the user selects one.

Validating Another State

Set Embed_API_QuickStart as the default workbook. Then manually switch to the Plugs Transactions workbook.

You'll now see a Clear Default button available for the user:

Set the Plugs Transactions as default and then switch to the Embed_API_QuickStart workbook.

Click Clear Default.

With this workflow, users can easily control which workbook appears when the page loads.

Footer

In this QuickStart, you learned how to implement a default workbook selection feature for embedded Sigma content using the Sigma API and local storage. This pattern helps personalize the embed experience, making it faster and easier for users to access the workbook they use most often.

Additional Resource Links

Blog
Community
Help Center
QuickStarts

Be sure to check out all the latest developments at Sigma's First Friday Feature page!

Footer