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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
pforchito
New Member

Getting data from a string (json like structure)

Hi Guys... I'm facing a problem to get a string from a field... the string is like a json structure:

{'id': 3489, 'name': 'Cesar Souza', 'picture_url': 'xpto.com/img.jpg', 'role': 'test'}

 

I need to get the name param...

 

3 REPLIES 3
PhilipTreacy
Super User
Super User

Hi @pforchito 

Download this PBIX file with a working solution.

You say it is JSON like because it's not actually valid JSON?

This query code will work.  Paste it into a blank query

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wqo4pNTAwMs9MgdBWCsYmFpY6ChBeXmJuKkwcQjunFicWKQTnl1YlQgRgSgsyk0tKi1LjS4tyUHVUFJTk6yXn5+pn5qbrZRWko2orys9Bs6EktbgEwqpVio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [json_string = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"json_string", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom",  each Text.Remove(Text.Split(Text.Split([json_string],","){1},":"){1},{"'"}))
in
    #"Added Custom"

jsonlike.PNG

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!


v-deddai1-msft
Community Support
Community Support

Hi @pforchito ,

 

If you are getting data from json file, here is a link with detailed steps for your reference: https://www.mssqltips.com/sqlservertip/4621/using-power-bi-with-json-data-sources-and-files/

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

 

parry2k
Super User
Super User

@pforchito assuming it is in a file, you can use text/csv as file source and transform json to get the value of the name column. What have you tried so far?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.