Excel Spreadsheet Automation on Adobe Target Data with the QUERY Formula



Pull data, automate spreadsheets, and more with the QUERY formula.

The CData Excel Add-In for Adobe Target provides formulas that can query Adobe Target data. The following three steps show how you can automate the following task: Search Adobe Target data for a user-specified value and then organize the results into an Excel spreadsheet.

The syntax of the CDATAQUERY formula is the following:

=CDATAQUERY(Query, [Connection], [Parameters], [ResultLocation]);

This formula requires three inputs:

  • Query: The declaration of the Adobe Target data records you want to retrieve, written in standard SQL.
  • Connection: Either the connection name, such as AdobeTargetConnection1, or a connection string. The connection string consists of the required properties for connecting to Adobe Target data, separated by semicolons.

    To connect to Adobe Target, you must provide the Tenant property along with OAuth connection properties mentioned below. Note that while other connection properties can influence processing behavior, they do not affect the ability to connect.

    To determine your Tenant name:

    1. Log in to Adobe Experience. The URL will look similar to: "https://experience.adobe.com/#/@mycompanyname/preferences/general-section".
    2. Extract the value after the "/#/@". In this example, it is "mycompanyname".
    3. Set the Tenant connection property to that value.

    User Accounts (OAuth)

    You must set AuthScheme to OAuthClient for all user account flows.

    Note: Adobe authentication via OAuth requires updating your token every two weeks.

    All Applications

    CData provides an embedded OAuth application that simplifies OAuth authentication. Alternatively, you can create a custom OAuth application. Review Creating a Custom OAuth App in the Help documentation for more information.

    Obtaining the OAuth Access Token

    Set the following properties to connect:

    • InitiateOAuth: Set to GETANDREFRESH to automatically perform the OAuth exchange and refresh the OAuthAccessToken as needed.
    • OAuthClientId : Set to the client Id assigned when you registered your app.
    • OAuthClientSecret : Set to the client secret assigned when you registered your app.
    • CallbackURL : Set to the redirect URI defined when you registered your app. For example: https://localhost:3333

    With these settings, the provider obtains an access token from Adobe Target, which it uses to request data. The OAuth values are stored in the location specified by OAuthSettingsLocation, ensuring they persist across connections.

  • ResultLocation: The cell that the output of results should start from.

Pass Spreadsheet Cells as Inputs to the Query

The procedure below results in a spreadsheet that organizes all the formula inputs in the first column.

  1. Define cells for the formula inputs. In addition to the connection inputs, add another input to define a criterion for a filter to be used to search Adobe Target data, such as Type.
  2. In another cell, write the formula, referencing the cell values from the user input cells defined above. Single quotes are used to enclose values such as addresses that may contain spaces.
  3. =CDATAQUERY("SELECT * FROM Activities WHERE Type = '"&B2&"'","Tenant="&B1&";Provider=AdobeTarget",B3)
  4. Change the filter to change the data.

Ready to get started?

Download a free trial of the Excel Add-In for Adobe Target to get started:

 Download Now

Learn more:

Adobe Target Icon Excel Add-In for Adobe Target

The Adobe Target Excel Add-In is a powerful tool that allows you to connect with live data from Adobe Target, directly from Microsoft Excel.

Use Excel to read, write, and update Adobe Target. Perfect for mass imports / exports / updates, data cleansing & de-duplication, Excel based data analysis, and more!