Dynamic Data Source to get a table with Email campaigns Results in Hubspot



I'm trying to create a dynamic datasource to get a table with all my campaigns in Hubspots and its results (Open, Clicks, etc) I need it without using input dropdown


I created a datasource with a list of my Campaigns IDs.

Then I need to create a dynamic datasource to get all the campaign data for each campaign ID.

How should I proceed?

1 comment

  • 0
    Janice Janczyn

    Hi Vicente,

    The Working with Dynamic Datasources article describes how to use a variable instead of a hard-coded ID in a datasource query. For example, if you want your Hubspot query to use the HBcampaignID variable instead of a specific campaign ID, replace the campaign ID in your query with {props.HBcampaignID}. 

    Then, to retrieve data for a list of campaign IDs, use the MAPFLAT function. As an example, the following assigns each value in campaignIDs, one at a time, to the variable named HBcampaignID (typed as a text string in quotes), then references the @/data field in the dynamic datasource.

            MAPFLAT( campaignIDs,
                               @/data )

    Note that the MAPFLAT will time out if there are too many campaignIDs to process, we recommend no more than 15-20 items.


Please sign in to leave a comment.