Sync lookup tables on a daily schedule
Recipe ToolsMarketingUtilities
What it does
When a scheduled time arrives each day, this automation truncates and rebuilds a merged lookup table. It retrieves town and state data, matches state abbreviations, maps results to a common data model, and populates the merged table so downstream processes always have current rankings.
Who it's for
Data and analytics teams who maintain lookup tables for downstream processes and need them refreshed on a predictable schedule.
How teams use this
Keep lookup tables current daily
Run the merge every morning so town and state data is always fresh. The schedule ensures processes downstream see the latest rankings without manual intervention.
Adjust the refresh schedule
Change the clock trigger to run at a different time or frequency, such as every 6 hours or weekly. Only the timing changes and the merge steps remain the same.
Add filtering by region or status
Include a condition in the lookup steps to filter town or state entries by region code or active status only. That narrows the merge to only the records the team needs.
How it works
- Run on a daily schedule. This automation starts every day at 12:00 AM so the lookup tables are ready before business hours.
- Clear the merged lookup table. Truncate all entries from the town_state_merge lookup table to remove stale data before the rebuild.
- Retrieve town and state rankings. Fetch all entries from rank_town and rank_state lookup tables in batch mode to prepare for the merge.
- Match and map to common data model. For each town entry, search rank_state lookup table, retrieve the state abbreviation, and map both to the Common data model State Town CDM.
- Populate the merged lookup table. Add each mapped entry to town_state_merge lookup table so the merged data is ready for queries and downstream processes.