Lookup and Relation
Last updated
Last updated
PowerTable allows you to configure any field in the table using the single-select input type. The lookup and relation field is specifically designed for setting up single-select type columns. In addition to manually configuring the dropdown options, PowerTable offers additional methods for sourcing values from dimensions, even if they reside in a different table or data source, through the use of lookup tables.
In summary, we have the following methods to configure the options:
Manual: Configure the dropdown options manually.
Distinct Values: Use the existing values in the column as a drop-down list with distinct options.
Lookup Table: Source values from another table in a database, which is usually done for foreign key fields.
This section will provide a detailed procedure for configuring dropdown values for each method.
This method allows you to type in the drop-down options and labels manually.
Let us take an example where the Product Color column options are set manually:
Click on the pencil icon beside the ProductColor field.
Choose Single Select and then Manual in the Type fields.
Enter the options and labels as required.
Click Save to save the configuration.
Click Add to add new options and the bin icon to delete an option.
You can now edit the table with the added dropdown options. PowerTable differentiates the single-select options by using different text-fill colors.
When you select this option, PowerTable creates a distinct list of options from the existing values.
In the table below, the Product Name field already contains a list of product names.
When you choose Distinct, these values become the drop-down options. Click Save.
You can now choose the product name from the list of distinct values that has been created. Notice how the column values are color-coded to indicate a single-select dropdown list.
PowerTable allows you to look up and source values from other tables as well.
When you select 'Lookup,' the highlighted section appears, where you can enter the schema name, the lookup table, the current table column containing the keys, and the lookup table column from which the drop-down options should be sourced.
Note: If there are any common columns between the lookup table and the current table, you can also set up filter criteria based on those matching columns. Only drop-down values that meet the filter criteria will be displayed, ensuring accuracy and ease of option selection.
Click Save to save the configuration.
The existing sub-category keys are replaced with their corresponding sub-category names using lookup.
For newly inserted rows, you can use the drop-down to select from these lookup values.
In the next section, we will look at the display settings.