Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
shaw1976
Frequent Visitor

Invalid Identifier while configuring my query for refreshing web sources in Power BI service

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.

 

relativePath.png

 

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.

 

1 ACCEPTED SOLUTION
PwerQueryKees
Super User
Super User

Get rid of the comma, keep the &

That will be syntacticly correct. 

View solution in original post

7 REPLIES 7
PwerQueryKees
Super User
Super User

Get rid of the comma, keep the &

That will be syntacticly correct. 

Thanks, that did it!

PwerQueryKees
Super User
Super User

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.

 

shaw1976_1-1723128493796.png

 

 

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.

PhilipTreacy
Super User
Super User

@shaw1976 

 

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



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


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.

 

relativePath2.png

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.