Skip to main content

data-transformation Scenario 5 — Script Transformation to Concatenate Names

Written by RTILA X Engineering Team

Advanced ~10 min
Prerequisites: data-transformation/3 data-transformation/4

What You'll Learn

Apply transformations dynamically based on data

Real-World Use Case

Building adaptive data pipelines

LIVE DEMO

First NameLast NameEmail
John Doe john.doe@example.com
Jane Smith jane.smith@example.com
Bob Johnson bob.johnson@example.com
Alice Williams alice.williams@example.com
Charlie Brown charlie.brown@example.com
EXPECTED OUTPUT

RTILA X PROJECT JSON

    {
  "name": "Script_Concatenate_Names",
  "settings": {
    "urls": [
      "https://learn.rtila.com/scenarios/data-transformation/5"
    ]
  },
  "datasets": {
    "full_names": {
      "item_selector": "css=table.name-table tbody tr",
      "properties": [
        {
          "name": "first_name",
          "type": "text",
          "selector": "css=td:nth-child(1)"
        },
        {
          "name": "last_name",
          "type": "text",
          "selector": "css=td:nth-child(2)"
        },
        {
          "name": "email",
          "type": "text",
          "selector": "css=td:nth-child(3)"
        }
      ]
    }
  },
  "commands": [
    {
      "command": "wait_for_selector",
      "params": {
        "selector": "css=table.name-table"
      }
    },
    {
      "command": "extract_data",
      "params": {
        "dataset": "full_names"
      }
    },
    {
      "command": "comment",
      "params": {
        "text": "Use a transform trigger in the trigger chain to concatenate first_name and last_name into full_name after extraction"
      }
    }
  ]
}
  

The script transformation executes custom logic during extraction. In this example, two property values are combined into a single full-name string.

Did you complete this scenario?

Ready to run this automation?

Copy the project JSON above, open RTILA X, create a new project, and paste it.

This scenario covers 2 RTILA X commands and is referenced in 2 learning articles.

Continue Learning

Was this helpful?