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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Expression.SyntaxError - Toke Comma Expected

Hello everyone.  I am trying to pull data from an external website into my excel file and I am getting a weird error message ->

Expression.SyntaxError: Token Comma expected.

 

Below is my below code and would really appreciate a new set of eyes on it to help identify where the error is coming from.  it looks like it may be on line 5 or 6.  Thanks!

 

let
Ticker= Excel.CurrentWorkbook(){[Name="Table1"]}[Content]{0}[Ticker1],
Source = Json.Document(Web.Contents("financialmodelingprep.com/api/v3/financial-ratios/" & Ticker & "?apikey=35c2f377815f4d1dd3d1654065134f33)),
ratios = Source[ratios],
#"Converted to Table" = Table.FromList(ratios, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"date", "investmentValuationRatios", "profitabilityIndicatorRatios", "operatingPerformanceRatios", "liquidityMeasurementRatios", "debtRatios", "cashFlowIndicatorRatios"}, {"date", "investmentValuationRatios", "profitabilityIndicatorRatios", "operatingPerformanceRatios", "liquidityMeasurementRatios", "debtRatios", "cashFlowIndicatorRatios"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Column1",{{"date", type date}, {"investmentValuationRatios", type any}, {"profitabilityIndicatorRatios", type any}, {"operatingPerformanceRatios", type any}, {"liquidityMeasurementRatios", type any}, {"debtRatios", type any}, {"cashFlowIndicatorRatios", type any}})
in
#"Changed Type"

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @Anonymous 

It's the Source line. You're not closing the string at the end. You can see it from the colors in the editor and by clicking on "Show error" it will take you to the approximate area of the error, if not the exact place. You have

"?apikey=35c2f377815f4d1dd3d1654065134f33))

Where's the " to indicate the end of the string? Try

Source = Json.Document(Web.Contents("financialmodelingprep.com/api/v3/financial-ratios/" & Ticker & "?apikey=35c2f377815f4d1dd3d1654065134f33" ) ),

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs

Cheers 

SU18_powerbi_badge

View solution in original post

1 REPLY 1
AlB
Super User
Super User

Hi @Anonymous 

It's the Source line. You're not closing the string at the end. You can see it from the colors in the editor and by clicking on "Show error" it will take you to the approximate area of the error, if not the exact place. You have

"?apikey=35c2f377815f4d1dd3d1654065134f33))

Where's the " to indicate the end of the string? Try

Source = Json.Document(Web.Contents("financialmodelingprep.com/api/v3/financial-ratios/" & Ticker & "?apikey=35c2f377815f4d1dd3d1654065134f33" ) ),

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs

Cheers 

SU18_powerbi_badge

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors