Convert list into multiple rows

hi,

i am getting the data in list which is list under list. so i want to print the data into multiple rows in label component.

i have 20 field so i want to print 20 rows which shows individual data.

i tried this code:
ds = system.dataset.toDataSet(['Column Name'], [ for x in list1])
return ds

but not working

please guide me

Something like this?

# data = your list of lists
return '\r\n'.join(','.join(row) for row in data) 

also i want to know that, am i doing right binding with the label component or shall i take different one?
because In label, data cannot be separated into the rows.

please guide me

Are you passing text in? Or the list of lists (as objects)

I'm not really sure what your end goal is. What are you trying to achieve?

i am getting the data from sql and append into the list by using transform.

A sql query returns a dataset, not a list though.

Can you show me an example of the output you want? And where are you wanting to display it?

You should never read tags 1 by 1, always read them in a single read by adding the tags into a list. A few other things as well, but too hard to type on my phone, I'll come back to these in an hr. I still don't know what you're expecting to see as a result?
It looks like this would be better presented in a table

1 Like

yes thatswhat i am also thinking

i want it on a label, not on a table.

Labels display text, not rows. What are you actually trying to do?

Configure a table so that the gridlines are hidden and the background color is the same as the background of your window. It will look the same.

how to hide gridlines in table

Vision or perspective?

{ The first screenshot is unambiguously Perspective. Adding the topic tag.. }

2 Likes

:man_facepalming:

probably some CSS stuff then.
I'm neck-deep in Vision at the moment, so I couldn't tell you without messing with it, but it should definitely be possible.

Is that Ignition's test to get a gold certification? :face_with_monocle:

I think you can get what you need from your original query.
From a dataset you can get a list and from a list you can make a single label with new lines ('\n') that can be shown in a single label component.

https://docs.inductiveautomation.com/display/DOC81/Datasets

I don't think you should read tags from that SQL query as they don't provide any information for it.

@aman_sharma This is using the same data as our Gold Certification test. The gold certification test does need to be your own work, not the work of people on the forums. The test document outlines what resources you can use to take the test.

5 Likes