Power Query - Example
Accessing 2ic Pallets Data via Power Query link arrow_upward
Working with 2ic Pallets data in power query requires authentication. If a user is unable to perform an action in the web app, they will also be unable to perform that action via power query with the same login.
2ic Software provides two options for power query integration:
Both of these systems use the same Power Query editor.
Getting Started with Excel link arrow_upward
Download the 2ic Excel Example Sheet for Excel:
In the zipped folder, right-click to extract all.
Open 2ic-power-query-excel-example.xlsx, then click Enable Content.
Select Data tab from the headers, then select Queries & Connections. This will open the Queries & Connections side panel, double-click Transactions.
This will open the Power Query Editor. This is the main location to edit queries and setup authentication details.
Continue to steps using power query.
Getting Started with Power BI link arrow_upward
Download the 2ic Power BI Example File:
In the zipped folder, right-click to extract all.
Open 2ic-power-bi-example.pbix, then click data on the right-side panel. Right-click transactions data source and click edit query.
This will open the Power Query Editor. This is the main location to edit queries and setup authentication details.
Continue to steps using power query.
Using Power Query link arrow_upward
Setting Authorisation link arrow_upward
- Open the web app https://app.2icsoftware.com/ and sign in. Click your name in the top-left corner of the page, and open My Details. Under API Access, copy the Access token.
- From the Power Query Editor left side panel, open Access_Token. Paste the copied access token into Current Value.
- Return to My Details, under API Access, copy the Database ID.
- Return to Power Query Editor, then from the left side panel, open DatabaseId. Paste the copied database ID into Current Value.
- Click Edit Credentials. Select Anonymous, then Connect.
- Data will appear in the preview window. This data contains all transaction columns.
- Click Close & Load. Otherwise, to customise the query further, continue to steps customising query.
Customising Query link arrow_upward
Altering Columns link arrow_upward
- In the Power Query Editor, double-click Transactions, then select Choose Columns. This is a complete list of the columns that the 2ic Pallets API returns for each transaction. Columns that are ticked here will be displayed in the final Excel sheet.
- To revert those changes, click the X on "Removed Other Columns".
Altering Displayed Row Count link arrow_upward
In the Power Query Editor, from the left side panel, select Row Count. Edit the row count in Current Value. This is the maximum rows that will be displayed.
Altering Filtering and Sorting link arrow_upward
- Open the web app https://app.2icsoftware.com/ and sign in. Open the Transactions page and set any filtering or sorting on the grid. This will be reflected in the Excel query.
- Press F12 on your keyboard to open Developer Tools. Select the Network tab.
- In the search box, type in transactions and select Fetch/XHR.
- Clear the network tab with the button above the search box, then use the blue refresh button in the 2ic grid to send a new query.
- Click the latest transaction query, then click Payload tab. Ensure view parsed is displayed. Copy all of the text from the request payload window.
You may need to click show more to display the entire query.
Return to the Power Query Editor window and open the Transaction Query Input section, then paste into the input box.
Refresh to see that the query has been altered to use the new filters.
Altering Recent Date Filtering link arrow_upward
In Power Query Editor, from the left side panel, select Recent Days. Edit the recent days in Current Value. This displays how many days (previous to today) to sort by.
Defining this value will overwrite any sending date filter in the Query Input.
Additional Information link arrow_upward
If any query is not working, explore errors by double-clicking ExpandedError on the right-side panel of the Applied Steps section in Power Query Editor.