This topic explains how to add string or number values for a Lookup Table Revision data schema and publish and manage Table Revisions. A Revision's data values only become available for calculations that reference the Lookup Table when the Revision is published:
Data can only be added to a draft Revision.
Only one Revision can be the published Revision for a Lookup Table at any given time.
You cannot change the data values of a published Revision.
If you want to use updated data values for the Lookup Table, you must:
Create a new draft Revision with the same data schema, add updated values you want to use for the Table, and publish the new Revision.
Alternatively, you can duplicate the published Revision as a new draft Revision, add updated values you want to use for the Table, and publish the new Revision.
When you publish a new Revision:
The current published Revision is automatically archived
Any Lookup functions in your calculations will now use the data values defined for the new published Revision.
In this way, you can manage and deploy Lookup Table Revisions for use cases where you need to quickly and dynamically update the data values used for your calculations.
This topic continues the variable discount rate example introduced in the previous topic and goes on to explain how to add data to, publish, and manage Lookup Table Revisions:
You can quickly add string and number values to draft Table Revisions.
To add data to a Table Revision:
1. Select Settings>Lookup tables. The Lookup tables page opens.
2. Select the Name hotlink text of the Lookup Table. The Lookup table details page opens.
3. Under Revisions, select the Name hotlink text of the draft Revision you want to add data to. The Revision details page opens.
4. Under Revision data, select Create. The Create page opens.
5. On Revision data details, enter the required string and number data values for the Revision field schema:
For the current variable discount rate example, we've entered two sets of rate and country data field values for the Revision schema we set up in the previous topic.
6. Select Create revision data. You are returned to the Revision details page and under Revision data the added data values are shown for the Revision fields:
We now have a Table Revision with the data values we want to use for our current discounted rate example added. To make these values available for any Lookup functions used in calculations, we must first publish the Revision - see the following section.
7. If you want to update the data you've added to the Revision before you publish it, under Revision data you can:
Select Edit to edit the Revision data details for all data fields.
Select the Edit button for a single data item to update it:
8. If you want to delete all the data you've added to the Revision:
Under Revision data select Delete. A confirmation dialog appears.
Select Yes to confirm deletion of all the data added to the Revision.
9. If you want to delete a single data item:
Select the delete icon for the data item:
A confirmation dialog appears. Select Yes to confirm deletion of the single data item.
Important: Adding data prevents updates to the Revision data field schema! If you add data values to a Revision, you will no longer be able to edit the Revision's data field schema to add additional fields, delete fields, change field order, or change keyed fields. See the following Managing Table Revisions section.
When you've added any required data values to a draft Table Revision, you can publish it and make the values available to any Lookup functions used in calculations that reference the Lookup Table.
To publish a Table Revision:
1. Select Settings>Lookup tables. The Lookup tables page opens.
2. Select the Name hotlink text of the Lookup Table. The Lookup table details page opens.
3. On the Revisions panel under Actions, select the Publish icon for the DRAFT Revision you want to publish:
The Revisions panel adjusts and shows the Revision's Status as PUBLISHED:
4. Alternatively, select the Name hotlink text of the Revision you intend to publish. The Revision details page opens:
On the Revision data panel you can review and check the values of the data fields for the draft Revision before you go ahead and publish it.
5. On the Revision details panel, select Publish:
A confirmation dialog appears and reminds you that this action will archive the currently published version.
6. Select Publish to confirm. The Revision details panel adjusts and shows the Revision as PUBLISHED:
Note that:
You cannot update or delete a PUBLISHED Table Revision.
Any Lookup functions used in calculations that reference the Lookup Table will now use the data values on the newly published Revision.
If you subsequently want to update a Revision to ensure different data values are used by Lookup functions, you must create a new draft Table Revision, populate it with the required data values, and publish the new Revision.
If you want to use the same data schema for the new Revision, you can simply duplicate the PUBLISHED Revision in draft status, update the data values, and then publish the duplicate to supersede the currently published Revision - see the following section.
We now have a published Revision of the Discount Vol Rates Lookup Table. This will make available to Lookup functions the data values we want to use for our current discounted usage rate example:
The following Worked Example topic explains how to set up a derived field on a Meter with a calculation that uses a Lookup function referencing the Discount Vol Rates Lookup Table. This function will apply the discount rates by country to measured usage. The example goes on the show how to check that Accounts in different countries are billed according to the appropriate discounted usage measures.
In many cases of using Lookup Tables to fulfill dynamic data mapping use cases, you'll want to use the same data schema as the currently published Table Revision. You can quickly duplicate the currently published Table Revision as a draft, add new data values as required, and then publish the updated draft Revision.
To duplicate a Table Revision:
1. Select Settings>Lookup tables. The Lookup tables page opens.
2. Select the Name hotlink text of the Lookup Table. The Lookup table details page opens.
3. Select the Name hotlink text of the Revision you want to duplicate. The Revision details page opens.
4. On the Revision details panel, select Duplicate:
The Create page opens.
5. Under Revision details, enter a Name for the new Table Revision:
Note that you can use the same Name as the Revision you are duplicating but the new Revision will be assigned its own unique ID.
6. If you want the duplicate Revision to have a different data schema to the original, you can add and delete data fields.
However, recall that any Table Revision must have at least one keyed field and one non-keyed field.
7. Select Create revision. The new duplicate Revision is created and the Revision details page opens
Note that:
The duplicate Revision is a DRAFT.
No Revision data values are inherited from the original Revision and you must add the required data values.
As an aid to managing Table Revisions, you can view the JSON for a Revision and open and compare it with another Table Revision's JSON.
To view Table Revision JSON:
1. Select Settings>Lookup tables. The Lookup tables page opens.
2. Select the Name hotlink text of the Lookup Table. The Lookup table details page opens.
3. Select the Name hotlink text of the Table Revision you want to view JSON for. The Revision details page opens.
4. On the Revision details panel, select View JSON. A modal opens allowing you to review the Revision's JSON:
You can Copy the JSON to your clipboard.
5. If you want to compare the Table Revision's JSON with that of another Revision, use the Select revision to compare drop-down to select the other Revision. The modal adjusts to add in the selected Revision as Comparator to the Original:
Differences in the JSON are highlighted.
6. Select Close to end your view Revision JSON session.
You can download a Lookup Table Revision's data in either JSONL or CSV format.
To download a Table Revision's data:
1. Select Settings>Lookup tables. The Lookup tables page opens.
2. Select the Name hotlink text of the Lookup Table. The Lookup table details page opens.
3. Select the Name hotlink text of the Revision whose data you want to download. The Revision details page opens.
4. On the Revision data panel, select Download data. A popup menu appears.
5. Select the format which you want to use for the download - Download JSONL or Download CSV:
The revision data is compiled in the selected format and a file downloaded locally.
You can then open the downloaded file using your preferred application and review the Revision's data.
Instead of manually adding Revision data, as explained in the previous section, you can upload either a JSONL or CSV formatted file to either create the initial Revision schema data values or to update the existing data values.
To upload Table Revision data:
1. Select Settings>Lookup tables. The Lookup tables page opens.
2. Select the Name hotlink text of the Lookup Table. The Lookup table details page opens.
3. Select the Name hotlink text of the Revision you want to upload data values for. The Revision details page opens and the Revision data panel shows the existing data values for the Revision schema fields:
4. On the Revision data panel, select Upload revision data:
The panel adjusts to allow you to either drag and drop a file or use Select files to open a File upload dialog to select a file for upload:
When you drag & drop or select a JSONL or CSV formatted file, the data values contained in the file are uploaded and used to either create new data values for the Revision schema fields or to overwrite existing values.
At upload, a validation check is performed against selected files. If a file is not correctly JSONL or CSV formatted or contains data fields that don't match the Revision's schema, then the upload is blocked and you'll receive an error.
You'll receive a confirmation when the upload job has succeeded:
5. Select Revision data. You can then check that the values contained in the uploaded file have either created new data values or updated the existing values:
You can edit or delete a draft Table Revision at any time. However:
You cannot edit a published or archived Table Revision.
You cannot delete a published Table Revision.
To manage Lookup Table Revisions:
1. Select Settings>Lookup tables. The Lookup tables page opens.
2. Select the Name hotlink text of the Lookup Table. The Lookup table details page opens.
3. If you want to edit a Table Revision, on the Revisions panel select the Edit icon:
Alternatively, select the Name hotlink text for the Revision to open the Revision details page and then select Edit.
The Edit page opens.
4. Make your editing changes and select Update revision.
Important: Data already added to a Revision! If you've already added data values to a Revision, when you open the Edit page, you will not be able to make any changes to the Revision's data field schema. You must first delete any data values, re-open the Edit page to make any required changes to the Revision's data field schema, and then add in new data values.
5. If you want to delete a Table Revision, on the Revisions panel select the Delete icon:
A confirmation dialog appears.
6. Select Delete to confirm the delete action.
Login to the Support portal for additional help and to send questions to our Support team.