Excel integration
You can use various methods to establish a connection between Cinchy and Microsoft Excel, such as using Basic Auth, Personal Access Tokens, or Bearer Tokens.
Review each section below for further details.
Prerequisites
Excel connects to queries within Cinchy, so before you use any of the connection methods below you will need to create one that represents your dataset. Once created, you will need to copy down the REST API URL endpoint, located as a green button on the right-hand side of the Execute Query screen.
The structure of the URL endpoint is <your Cinchy instance URL>/API/<the name of your query>
. You might optionally have querystring
parameters at the end as well.
For example: http://your.cinchy.instance.domain/API/YourQueryDomain/API Test
Note that for Basic Authentication with a result format of CSV we will use a slightly different URL endpoint.\
For Basic Auth: /API/ becomes /BasicAuthAPI/\
For CSV results you will add the querystring
parameter of ResultFormat=CSV
Our example URL of a basic auth using CSV results would then become: http://your.cinchy.instance.domain/BasicAuthAPI/YourQueryDomain/API Test?ResultFormat=CSV
Use basic auth
- Launch Excel and navigate to Data > Get Data > From Other Sources > Blank Query (Image 1).
- In the expression box that appears, enter the below text to add in your query as your data source (Image 2):
=Csv.Document(Web.Contents("API ENDPOINT URL"))
Example:
=Csv.Document(Web.Contents("http://your.cinchy.instance.domain/BasicAuthAPI/YourQueryDomain/API Test?ResultFormat=CSV"))
- Once you've entered that text either click the check mark to the left of the input box or click away and it will automatically attempt to run the expression.
- The data may return in HTML format initially and not be what you're expecting. To correct this:
- Select the Data Source Settings.
- Select Basic and enter the credentials for a Cinchy User Account that has access to run this query.
- Select OK.
- Within the Edit Permissions dialogue, click OK.
- Within the Data Source Settings dialogue, click Close.
- Select Refresh Preview.
- Select Close & Load and your dataset will be displayed in the Excel worksheet.
Use a Personal Access Token (PAT)
-
If needed, follow the documentation here to generate a new PAT.
-
Launch Excel and navigate to Data > From Web.
-
Select Advanced and input the following values:
- URL Parts: This is the Query API URL that you created in the Prerequisites section.
- HTTP Request Header Parameters:
- In the first text box input Authorization
- In the second text box type Bearer + your PAT. For example: "Bearer BGFHFHOJDF76DFDFD777"
-
Select OK.
-
Select Load to use the query data in Excel.
Use a Bearer Token
-
If needed, follow the documentation here to generate a Bearer Token.
-
Launch Excel and navigate to Data > From Web.
-
Select Advanced and input the following values:
- URL Parts: This is the Query API URL that you created in the Prerequisites section.
- HTTP Request Header Parameters:
- In the first text box input Authorization
- In the second text box type Bearer + your token. For example: "Bearer eyUzI1NiIsImtpZCI6IkE4M0UwQTFEQTY1MzE0NkZENUQxOTFDMzRDNTQ0RDJDODYyMzMzMzkiLCJ0eXAiO"
-
Select OK.
-
Select Load to use the query data in Excel.