Skip to main content

complex-workflows Scenario 7 — Three-Site Data Merge

Written by RTILA X Engineering Team

Advanced ~10 min
Prerequisites: complex-workflows/4 complex-workflows/5 complex-workflows/6

What You'll Learn

Build a complete login-to-dashboard-to-report pipeline

Real-World Use Case

Automating daily KPI dashboards

LIVE DEMO

Three-Site Data Merge

Extract company, rating, and revenue tables and read the merged output.

Company
Acme Corp
Globex
Initech
Umbrella Corp
Stark Industries
Rating
4.2
4.5
3.8
4.1
4.9
Revenue
$2.1B
$5.3B
$1.4B
$8.2B
$12.7B
CompanyRatingRevenue
Acme Corp4.2$2.1B
Globex4.5$5.3B
Initech3.8$1.4B
Umbrella Corp4.1$8.2B
Stark Industries4.9$12.7B
EXPECTED OUTPUT

Merged Companies

company rating revenue
Acme Corp 4.2 $2.1B
Globex 4.5 $5.3B
Initech 3.8 $1.4B
Umbrella Corp 4.1 $8.2B
Stark Industries 4.9 $12.7B
RTILA X PROJECT JSON

RTILA X Automation Project

three-site-data-merge.json
{
  "name": "Three_Site_Data_Merge",
  "settings": {
    "urls": [
      "https://learn.rtila.com/scenarios/complex-workflows/7"
    ]
  },
  "datasets": {
    "companies": {
      "item_selector": "css=table.cw-companies tbody tr",
      "properties": [
        {
          "name": "company",
          "type": "text",
          "selector": "css=td:nth-child(1)"
        }
      ]
    },
    "ratings": {
      "item_selector": "css=table.cw-ratings tbody tr",
      "properties": [
        {
          "name": "rating",
          "type": "text",
          "selector": "css=td:nth-child(1)"
        }
      ]
    },
    "revenues": {
      "item_selector": "css=table.cw-revenues tbody tr",
      "properties": [
        {
          "name": "revenue",
          "type": "text",
          "selector": "css=td:nth-child(1)"
        }
      ]
    },
    "merged_companies": {
      "item_selector": "css=table.cw-merged-companies tbody tr",
      "properties": [
        {
          "name": "company",
          "type": "text",
          "selector": "css=td:nth-child(1)"
        },
        {
          "name": "rating",
          "type": "text",
          "selector": "css=td:nth-child(2)"
        },
        {
          "name": "revenue",
          "type": "text",
          "selector": "css=td:nth-child(3)"
        }
      ]
    }
  },
  "commands": [
    {
      "command": "extract_data",
      "params": {
        "dataset": "companies"
      }
    },
    {
      "command": "wait_for_selector",
      "params": {
        "selector": "css=table.cw-ratings"
      }
    },
    {
      "command": "extract_data",
      "params": {
        "dataset": "ratings"
      }
    },
    {
      "command": "wait_for_selector",
      "params": {
        "selector": "css=table.cw-revenues"
      }
    },
    {
      "command": "extract_data",
      "params": {
        "dataset": "revenues"
      }
    },
    {
      "command": "comment",
      "params": {
        "text": "Trigger chain merges the three datasets into merged_companies"
      }
    },
    {
      "command": "wait_for_selector",
      "params": {
        "selector": "css=table.cw-merged-companies"
      }
    },
    {
      "command": "extract_data",
      "params": {
        "dataset": "merged_companies"
      }
    }
  ]
}

Three independent datasets can be merged by a trigger chain. The merge operation aligns rows by position or key and produces the combined table.

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 3 RTILA X commands and is referenced in 1 learning article.

Continue Learning

Was this helpful?