Dropdown list in vision

Hi Guys,

I'm trying to in the dropdown list display text "All Record". In below screenshot shows a list from the database correctly I'm trying to add "All Record" text in the first row but "All Record" is not available in database.

Any ideas on how to add "All Record" text in the dropdown list?

image

Thanks,
Priyanka

Maybe something like this:

SELECT '-1', 'All Record'
UNION
<existing query>
6 Likes

Found below error:

All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists.

Basically the first query must match the column count in your query.

Edit, do a quick Google, it will do a better job explaining than I can.

4 Likes

Hi Guys,

Resolved my problem using the following query but get output in order by my case "Exporting all formulas" This text always displays at the top.

SELECT 'Exporting all formulas' AS col1
UNION
SELECT Name AS col1 FROM Test

Any idea?

Thanks,
Priyanka

Resolved using following script:

headers = ['col1']
data = []
data.append(['Exporting all formulas'])
options = system.dataset.toDataSet(headers, data)
print options 
query = "Select Name from Test"
pyDataset = system.db.runPrepQuery(query)
normalDataset = system.dataset.toDataSet(pyDataset)
print normalDataset
appendDataset = system.dataset.appendDataset(options, normalDataset)
print appendDataset
event.source.data = appendDataset