Forum Discussion
Converting a table to javascript array of objects
- 4 years ago
Try putting the value into a table visual then copying it from there.
Thanks. I am not doing CTRL+C on the PQ console.
I am doing this
and pasting in chrome DEV tools, which comes out like this and it is not what I want.
Is it possible that it gets loaded to the correct js array of object format so that, I don't have to take any extra steps?
- Watsky4 years ago
Solution Sage
Try putting the value into a table visual then copying it from there.
- smpa014 years ago
Community Champion
Anyone coming back to this thread in future, just so you know, Watsky 's method works but only for a small dataset. For large tables, only partial values get loaded into DAX tables as DAX has limitations for datatype `string`. The only safe way to make it to work is to take the values from PQ Console once it gets transferred to JSON.
- Vijay_A_Verma4 years ago
Most Valuable Professional
If you paste this in a text based editor, then this is bound to happen for strings containing quotes.
To avoid this, you will have to first paste in non text based editor like Word and then copy from Word and then paste into a Chrome editor. If you take right click in Word / Wordpad and paste as text, then additional quotes will appear again.
But above workaround is an additional step which you don't want. I did try to experiment with Chrome Dev tool to see if some setting or any other trick can bypass this. But I was not successful as core of Chrome Dev tool looks to be text only.
Let's see if somebody can find a way to bypass this in Chrome dev tool.