Sorting "merged" hubdb by different column names

I’m using the below method to “merge” data from two different hubdb tables

{% set table1 = hubdb_table_rows(xxxxxxx, query) %}
{% set table2 = hubdb_table_rows(yyyyyyy, query) %}

{% set all_tables = (table1 + table2) %}
{% set all_sorted = all_tables|sort(false,false,'date') %}

I’ve acheived this by giving table1 and table2 a column named “date”. But originally they were different column names. table1 had a column named “date”. table2 had a column named “start_date”.

I’m happy enough with the column rename method. But out of curiosity is there a hubl method I could use to “merge” all the data and treat the “date” column and the “start_date” column as one column without resorting to renaming one of them?

Hey @BarryGrennan

Going to throw a couple heavyweights into the convo here :grinning_cat:

@stefen , @alyssamwilie you all have ideas?

@BarryGrennan @dennisedson I’m not sure if this would work since they aren’t simple lists/arrays. But the `extend` function seems like the exact thing you need — it merges two arrays into one: HubL functions - HubSpot docs

{% set table1 = hubdb_table_rows(xxxxxxx, query) %}
{% set table2 = hubdb_table_rows(yyyyyyy, query) %}

{% set table1.extend(table2) %}