Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello, I am using Query Parameters to format a call to an API to return data for a given trackingId.
I have a table with userName, trackingId. I want to call an API to populate a new table, the input to that call is trackingId
"https://apibaseurl.com" & "/application?trackingId=" & Uri.EscapeDataString(trackingId)"
I want a user to be able to enter a userName in the parameter, but have the query use the trackingId of that userName
I have created the lookup table called device containing alias(name), mac(id), and the list of alias called l_device_username, using that query I created a parameter trackingUser.
I added this to the query
#"device" = {[alias=#"trackingUser"]}[mac],
Source = Json.Document(Web.Contents("https://apibaseurl" & "/application?trackingId=" & Uri.EscapeDataString(#"device") & "&startTime=" & Uri.EscapeDataString(startTime) & "&endTime=" & Uri.EscapeDataString(endTime), [Headers=[#"Content-Type"="application/json", #"Api-Key"="*"]])),
content = Source[content],
But get this error:
Expression.Error: We cannot apply field access to the type List.
Details:
Value=[List]
Key=mac
Hi @aammontecas
I would approach this problem by creating a Table with two columns. Name and ID.
A List of Name can be created using the "Name" column. This List of Names can be used in the Parameter settings. This is example from the Manage Parameters panel.
Finally, in the main API call, you can use the "Name" value to search for the "ID" value. The M script is something like this:
#"Name Table"{[Name=#"Parameter Value"]}[ID]
This seraches for the Table, finds the row number for the parameter name and then returns the ID value.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
8 | |
6 | |
5 | |
5 | |
5 |
User | Count |
---|---|
10 | |
8 | |
6 | |
6 | |
6 |