Skip to content
English
  • There are no suggestions because the search field is empty.

Use Cargosnap Data in Excel or Power BI via Power Query

Sometimes you just want your data—your way. Whether it’s analysing completed workflows, filtering files, or exploring form submissions, many teams rely on Excel or Power BI to make sense of their day-to-day operations.

That’s why we’ve made it easy to connect your Cargosnap data directly into Power Query—the engine behind data transformations in both Excel and Power BI.

A couple of warnings first:

  • This article is aimed at developers and office tigers; it is technical and demonstrates tools and techniques that are not commonly seen by business users.

  • Cargosnap uses tools such as Excel, Power Query and Power Automate in these examples. These are Microsoft solutions and not part of the product offering of CargoSnap. We do not provide, sell or support these tools! We just think they are awesome to achieve business goals, but you may choose a competing product or use the described functionality in your own WMS/TMS.

  • Our API's (see API documentation) are useful to pull the data you need. Kindly use them with common sense: we have a fair use policy (but also some hard limits, to protect the use for all our customers). What that means is, do not call the API more than you need and avoid repeating calls. Use our documented methods to pull only incremental data.

Why use Power Query?

Power Query lets you pull live, structured data into tools you already use, without needing to manually export files. With just a few clicks, you can:

  • Filter for specific workflows or file types
  • View form submissions with selected fields
  • Build dashboards to track issues or trends
  • Combine Cargosnap data with other sources

What kind of data can I access?

The API (see API documentation) makes key entities available, including:

  • Files (including metadata like date, location, user)
  • Workflows and their statuses
  • Forms and custom fields used in submissions

This gives you control over what data you want to analyse—whether it’s for a KPI dashboard in Power BI or a filtered report in Excel.

Keeping things simple

We believe in low-friction solutions. This approach doesn’t require a custom integration, scripting, or advanced setup. Just follow a few setup steps, connect to the data source from Power Query, and start shaping your reports.

We’ve created a short video showing you exactly how to get started.

Watch the video tutorial:

 

Here is the code snippet we use in the video. Do remember to put your own token in, as well as any of the other query parameters such as the date range and the various include parameters (remove the // to also include the items listed in there).

let
    Source = List.Skip(List.Generate( () => [Counter = 0, isMore = true],        
        
        each  [isMore] <> false,
            
            each [WebCall = Json.Document(Web.Contents( "https://api.cargosnap.com/api/v2/files?" 
              & "token=[MY-API-TOKEN]"
                & "&limit=250"
//                & "&include[]=fields"
//                & "&include[]=workflows"
//                & "&include[]=forms"
                & "&startdate=" & Date.ToText(Date.AddMonths(DateTime.Date(DateTimeZone.LocalNow()),-3),[Format="YYYY-MM-DD"])
                & "&page=" & Number.ToText(Counter))),
            
                isMore = if [Counter] < 1 then null else
                    if [WebCall][current_page] = [WebCall][last_page] then false else true, 
            
                Counter = [Counter] + 1
            
            ]
    ), 1),
    #"Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)

in
  Source

Need help getting set up? Feel free to reach out to us!