- Print
- DarkLight
- PDF
Use Parameters in an Excel Data Extraction API Request
Article summary
Did you find this summary helpful?
Thank you for your feedback
You can create a URI with a parameter instead of a specific value.
You can link a parameterized value to a cell so that the value updates when the worksheet is refreshed. To view multiple time periods for a report, you could create a single URL with a parameterized time period, so that Excel prompts you to change the time period value when you refresh the data.
Version number
The version number you will use is dependant upon the version of Analytics you have installed. Analytics versions 9.5 and below, use v2_0. Analytics versions 9.5.1 and above will use v2_1.
- Create the URL for the report you want. Specify the HTML format, and ensure that you have a valid start period and end period for the report (data may not exist for all time periods).
- Follow the instructions in Import Data Into Excel.
- Identify the value(s) in the URL that you want to change to a parameter. An example with the start_period value is shown below:
https://myDomain.com/{version}/ReportService/profiles/CxoSsHxKlF6/reports/42df19b6d9f2/?start_period=2023m06d01&end_period=CURRENT_DAY-1&format=html&suppress_error_codes=true - Copy the URL, and edit the copy of the URL to replace the values with square brackets. For example:
https://myDomain.com/{version}/ReportService/profiles/CxoSsHxKlF6/reports/42df19b6d9f2/?start_period=[]&end_period=CURRENT_DAY-1&format=html&suppress_error_codes=true - Select "Data" from the menu ribbon.
- Click the text with the down arrow "Refresh All" and then click "Connection Properties".
- Click on the Defintion tab.
- Click "Edit Query".
- Replace the URL in the Address bar with the address you edited.
- On preview, an invalid page request error occurs. Ignore this and click Import.
- Click "Parameters...".
- Edit each parameter (in order of how they appear in the URL). Add a value under "Prompt for value using the following string:"
- Click "OK".
- Click "Refresh All"
- A prompt appears
- Provide a valid value for the parameter and click "OK". Your spreadsheet will show report data.
Was this article helpful?