Start integrating with ONEiO for free!
SIGN UP

Exporting Spreadsheet Data to a Routing Rule's Table Mapping

Introduction:

Sometimes there is a need to add a lot of mappings inside a Conditional Mapping. Doing it manually can be time-consuming, so there is a possibility to map all the table mapping in a simple spreadsheet and then, export it to the Conditional Mapping rule.

This example shows how to do it with Google Sheets. If you need to acquire the spreadsheet data from an existing Routing rule, see first Export a Conditional Mapping from a Routing Rule to a CSV / Spreadsheet

Step-by-Step:

Step 1: Download the attached file TranslationTable Json Generator.xlsx

Step 2: Choose one of the examples and edit de data.

The sheet 1 value to 1 target will create an output from 1 value to 1 target, as the example below:

{
    "source": [
        {
            "value": "new"
        }
    ],
    "target": [
        {
            "value": "0"
        }
    ]
}

And the sheet 2 values to 3 targets will create an output from 2 values to 3 targets, as the example below:

{
    "source": [
        {
            "value": "0"
        },
        {
            "value": "0"
        }
    ],
    "target": [
        {
            "value": "all down"
        },
        {
            "value": "Critical"
        },
        {
            "value": "A3"
        }
    ]
}

You can create as many sources to targets you want, matching the number of sources to targets in the Conditional Mapping you want to modify.


The last column with data will be the one you need to copy to the TranslationTable JSON, as in the example below. It's suggested to format it and/or check for errors.

ONEiO__Knowledge_Base_-_Table_Mapping_Export_1.jpg

In this example, you should copy the data from the column M

 

Step 3. Open the rule's JSON and paste the data in the translationTable you want to modify:

ONEiO__Knowledge_Base_-_Table_Mapping_Export_2.jpg

Paste the data between the brackets of translationTable element. If you added more columns in source or value, change also the element sourceAttributes or targetAttributes to match the number of columns you have in your spreadsheet.

 

Step 4. Import the rule's JSON in the rule you want to update:

ONEiO__Knowledge_Base_-_Table_Mapping_Export_3.jpg

Either "drag and drop" the JSON file into the upload modal, or choose the file from the explorer.

You successfully imported the new JSON if you see the message "Success: Rule Template Imported", and you are redirected to the rule editing mode.
If there is an error, you may see the message "Failed to import Rule: Unable to parse the file content"In this case, is necessary to review your code and look for missing brackets or syntax errors.

Step 5. Review the imported rule and save it.

Don't forget to enable the rule if it is disabled.

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.