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 All,
I'm trying to factor my query to allow auto refresh from the power bi service by using the RelativePath. The "Invalid Identifier" error is occuring when I call the function that has the bearer token.
let
Source =
Json.Document(Web.Contents("https://admin.10ten.com/api/v2/",
[RelativePath="students?",
Query = [
Year="2024",
IsEnrolled="true",
PageSize="500",
Headers=[Authorization= Bearer, bearer()]
]
]
)
),
The function is called with no issue when I execute the query this way.
Source = Json.Document(Web.Contents("https://admin.10ten.com/api/v2/students?" & "Year=2024&" & "IsEnrolled=true&" & "PageSize=500", [Headers=[Authorization="Bearer " & bearer()]])),
Any guidence is greatly appreciated.
Solved! Go to Solution.
Get rid of the comma, keep the &
That will be syntacticly correct.
Thanks, that did it!
Your original that worked said "
Authorization="Bearer " & bearer()
"
Why did you change it to
Authorization= Bearer, bearer()
These two are totally different, with the new version violating the M language syntax for a record...m
@PwerQueryKees , sorry for taking so long to reply. I was on vacation then handling a few issues that occured during my abscense.
When I include the ampersand I get a 'Invalid identifier' error.
Any advice or guidence you can offer is appreciated very much.
Thank you for your reply. I have been on vacation. I will address this by EOD tomorrow and mark as resolved if it solves the issue.
Try moving the bearer() function out of the Headers e.g.
let
token = bearer(),
Source =
Json.Document(Web.Contents("https://admin.10ten.com/api/v2/",
[RelativePath="students?",
Query = [
Year="2024",
IsEnrolled="true",
PageSize="500",
Headers=[Authorization= Bearer, token]
]
]
)
),
regards
Phil
Proud to be a Super User!
Thank you for your reply Phil, much appreciated.
I'm sorry, this does not work. I implimented it that way first, I recieve the error "Token '=' expected" on line ten.
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 |
---|---|
9 | |
8 | |
6 | |
6 | |
6 |