Create a Table in the Data Store

Next, let’s create a table in the Data Store in the LeadManager project. This table is used to store the Refresh Token and userID values, which are retrieved whenever an Access Token needs to be generated.

To create a table:

  1. Navigate to Data Store under Develop.
    catalyst_leadmanager_create_table_1
  2. Click Create a new Table.
  3. Enter the table’s name as “Token” and click Create.
    catalyst_leadmanager_create_table_2
Note: Ensure that you enter the name exactly as instructed, because the application's code contains the same name.

The table will be created and displayed in the Data Store page.

Now, let’s create two columns in the table to store the userID and the Refresh Token

  1. Click New Column in the Schema View section for the table.
    catalyst_leadmanager_create_column_1
  2. Enter the column’s name as “refresh_token”. Select the data type as Encrypted Text.
    catalyst_leadmanager_create_column_2
    You can learn about the various data types supported by Catalyst and the other properties of a column from the Data Store help page.
Note: Ensure that you enter the name exactly as instructed, because the application's code contains the same name.
  1. Click Create.

Create another column using the previous steps with the column name as “userId” of the data type “Int”. You need not provide any other values.

catalyst_leadmanager_create_column_3

The columns will be created and listed in the Schema View section.

catalyst_leadmanager_column_created

Configure Scopes and Permissions

To allow any user of the Lead Manager application to view or manage leads from the client application, you must enable an additional table permission that will allow the user to fetch and store new Refresh Tokens, if needed.

Click the Scopes and Permissions tab for the Token table, then check the Insert permission for the App User role. The Select permission will already be checked by default.

catalyst_leadmanager_enable_permissions_datastore

The Data Store is now configured for the application.

Last Updated 2023-12-19 12:35:38 +0530 +0530

RELATED LINKS

Data Store