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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
smpa01
Super User
Super User

Convert text to record

@ImkeF @AlexisOlson 

 

I am making an API call that returns a json as text like this

 

let
    Source = "{
	""header"": [""[Value]""],
	""rowCount"": 1,
	""data"": [
		[2.0]
	]
}",
    #"Converted to Table" = #table(1, {{Source}})
in
    #"Converted to Table"

 

 I want to retrieve the value of "data" and what is an efficient way of doing it. Is it possible to convert this into a PQ Record with any built-in API so that I can progrmatically access them. It already contains the key value pairs.

 

Thank you in advance.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Power Query has built-in JSON parsing.

 

let
    Source = "{
	""header"": [""[Value]""],
	""rowCount"": 1,
	""data"": [
		[2.0]
	]
}",
    #"Parsed JSON" = Json.Document(Source)
in
    #"Parsed JSON"

 

AlexisOlson_0-1709659467252.png

 

To grab just 2.0,

Json.Document(Source)[data]{0}{0}

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

Power Query has built-in JSON parsing.

 

let
    Source = "{
	""header"": [""[Value]""],
	""rowCount"": 1,
	""data"": [
		[2.0]
	]
}",
    #"Parsed JSON" = Json.Document(Source)
in
    #"Parsed JSON"

 

AlexisOlson_0-1709659467252.png

 

To grab just 2.0,

Json.Document(Source)[data]{0}{0}

@AlexisOlson  Smashing !!!

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.