question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to return JSON array instead of text for specific column

See original GitHub issue

I want to return a JSON array from an extractor like this:

`

10 : function(cellIndex , $cell){
                    var prlArray = [];
                    $cell.find('select option').each(function(){
                        //alert(this.value);
                        prlArray.push(this.value);
                    });
                    return JSON.parse(prlArray.toString());
                }

`

This extractor is causing error in because of “return JSON.parse(prlArray.toString());” thanks in advance

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
koshuangcommented, May 9, 2017

@SamehMahmoud I @lightswitch05 I submitted a PR #37 which should be able to fix this issue.

0reactions
lightswitch05commented, May 10, 2017

released in 0.12.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

PostgreSQL return result set as JSON array? - Stack Overflow
This section describes how to generate a JSON object, with each key being a column in the table and each value being an...
Read more >
Solve common issues with JSON in SQL Server
Answer. If you want to return an object or an array as a column, use the AS JSON option in the column definition,...
Read more >
The JSON_QUERY() function to extract objects from JSON Data
In this article, we will explore JSON_QUERY() functions in SQL Server to extract JSON objects and array from the JSON Data.
Read more >
9.3: JSON Functions and Operators - PostgreSQL
Function Return Type Example Example Result array_to_json(anyarray ) json array_to_json(''::int) row_to_json(record ) json row_to_json(row(1,'foo')) to_json(anyelement) json to_json('Fred said "Hi."'::text) "Fred said \"Hi.\""
Read more >
Postgres multiple columns to json - DBA Stack Exchange
Does this build an object array instead of returning duplicate outer query results? – TheRealChx101. Dec 12, 2021 at 16:51. Add a comment ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found